table = input()
num = []
Right_ISBN = []
sum = 0
for char in table:
if char != '-':
num += char
for i in range(1,len(num)):
sum += int(num[i-1]) * i
verification_code = sum % 11
if verification_code == 10:
Right_ISBN = list(table)
Right_ISBN[len(table)-1] = 'X'
else:
Right_ISBN = list(table)
Right_ISBN[len(table)-1] = str(verification_code)
if Right_ISBN == list(table):
print("Right")
else:
for i in Right_ISBN:
print(i,end='')