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