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