while True:
try:
i,s,b,n=map(str,raw_input().strip().split('-'))
x=i+s+b
li=[i,s,b]
s=0
k=1
for j in range(len(x)):
s+=int(x[j])*k
k+=1
ys=s%11
if (ys==10 and n=='X') or (str(ys)==n):
print 'Right'
else:
lj='-'
if ys==10:
li.append('X')
else:
li.append(str(s%11))
print lj.join(li)
except EOFError:
break