while True:
try:
n=input()
m=n.replace("-","")
s=0
for j in range(1,10):
s=s+j*int(m[j-1])
y=s%11
if y==10:
if n[-1]=="X":
print("Right")
else:
l=n[:-1]+"X"
print(l)
else:
if n[-1]==str(y):
print("Right")
else:
l=n[:-1]+str(y)
print(l)
except EOFError:
break