def f(s):
n = (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) % 11
if n == 10:
n = "X"
return str(n)
while True:
try:
s = input()
n = f(s)
if n == s[-1]:
print("Right")
else:
print(s[0:12] + n)
except EOFError:
break