while True:
try:
t = input()
s = list(t)
s.remove('-')
s.remove('-')
s.remove('-')
yx = sum( list(int(s[i])*(i+1) for i in range(len(s)-1))) % 11
print( ( t[0:-1] + (str(yx) if yx != 10 else "X") ) if yx != int( t[-1] if t[-1] != "X" else 10 ) else "Right" )
except EOFError:
break