def check(li):
s=0
t=0
for i in range(len(li)-1):
if li[i] == '-':
t=t+1
else:
s+=int(li[i])*(i+1-t)
if s % 11==10:
a='X'
else:
a=str(s % 11)
if a==li[-1]:
return 'Right'
else:
return li[0:12]+a
while True:
try:
s=input()
print(check(s))
except EOFError:
break