while True:
try:
a=input()
s=0
total=''
num1=a.split('-')
for i in num1:
total+=i
for i in range(len(total)-1):
s+=(i+1)*int(total[i])
if s % 11==10 and total[9]=='X':
print('Right')
elif str(s % 11)==total[9] and s % 11 <10:
print('Right')
elif s % 11==10 and total[9]!='X':
print(total[0]+'-'+total[1:4]+'-'+total[4:9]+'-'+'X')
else:
print(total[0]+'-'+total[1:4]+'-'+total[4:9]+'-'+str(s % 11))
except EOFError:
break