while 1:
try:
s = list(input())
ans = 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
ans = ans % 11
if s[12] == 'X' : res = 10
else : res = int(s[12])
if ans == res : print("Right")
else:
if ans == 10 : s[12] = 'X'
else : s[12] = str(ans)
for i in s:print(i, end = "")
except:break