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