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