while True:
try:
s=input()
total=int(s[0])*1+int(s[2])*2+int(s[3])*3+int(s[4])*4+int(s[6])*5+int(s[7])*6+int(s[8])*7+int(s[9])*8+int(s[10])*9
yu=total % 11
if s[-1]!='X':
sbm=int(s[-1])
else:
sbm=10
if yu==sbm:
print('Right')
elif yu==10:
print(s[0:12]+'X')
else:
print(s[0:12]+str(yu))
except EOFError:
break