while True:
try:
s=input()
t=int(s[0])+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
m=t%11
if (s[-1]=="X" and m==10 ) or (s[-1]!="X" and s[-1]==str(m)):
print("Right")
else:
if m==10:
print(s[:-1]+"X")
else:
print(s[:-1]+str(m))
except EOFError:
break