while True:
try:
isbn=input()
f="".join(list(isbn.split('-')))
s=0
for i in range(len(f)-1):
s=(int(f[i])*(i+1))+s
s=s%11
if "X"==f[-1]:
if s==10:
print("Right")
else:
isbn=isbn[:-1]+str(s)
print(isbn)
else:
if s==int(f[-1]):
print("Right")
else:
if s==10:
s="X"
isbn=isbn[:-1]+str(s)
print(isbn)
except EOFError:
break