while True:
try:
s = input()
s1 = s.replace("-","")
d = sum([int(s1[i])*(i+1) for i in range(len(s1)-1)])%11
if d==10:
if s[-1] == "X":
print("Right")
else:
print(s[:-1]+"X")
else:
if s[-1] == str(d):
print("Right")
else:
print(s[:-1]+str(d))
except EOFError:
break