while True:
try:
b = input()
a=b.split("-")
e=list(map(int,list("".join(a[:-1]))))
for i in range(9):
e[i]=e[i]*(i+1)
total=sum(e)%11
if a[-1] == "X":
if total == 10:
print("Right")
else:
print(b[:-1]+str(total))
else:
if b[-1] == str(total):
print("Right")
else:
if total == 10:
print(b[:-1]+"X")
else:
print(b[:-1]+str(total))
except EOFError:
break