#coding=utf-8
while True:
try:
a = raw_input()
sum = int(a[0]) + int(a[2])*2 + int(a[3])*3 + int(a[4])*4 + int(a[6])*5 + int(a[7])*6 + int(a[8])*7 + int(a[9])*8 + int(a[10])*9
sum %= 11
if a[12] == 'X':
if sum == 10:
print 'Right'
else:
a = a[:12] + str(sum)
print a
else:
if int(a[12]) == sum:
print 'Right'
else:
if sum == 10:
a = a[:12] + 'X'
else:
a = a[:12] + str(sum)
print a
except EOFError:
break