while True:
try:
bm=raw_input()
bmn=bm.replace("-","")
sum=0
for i in range(len(bmn)-1):
sum+=int(bmn[i])*(i+1)
t=sum % 11
if t==10:
s="X"
else:
s=str(t)
if s==bmn[len(bmn)-1]:
print "Right"
else:
print bm[:len(bm)-1]+s
except EOFError:
break