while True:
try:
lm=input().split('-')
ln=lm[:-1]
la=[]
for n in ln:
p=list(n)
for t in p:
la.append(int(t))
total=0
for k in range(len(la)):
total+=(k+1)*la[k]
total=total%11
if total==10 and lm[-1]=='X':
print('Right')
elif total==10 and lm[-1]!='X':
lm[-1]='X'
print("-".join(lm))
elif str(total)==lm[-1]:
print('Right')
else:
lm[-1]=str(total)
print("-".join(lm))
except EOFError:
break