while True:
w =raw_input().strip('-')
ss=0
t=0
for i in range(len(w)-1):
if w[i]=='-':
t=t+1
else:
ss+=int(w[i])*(i+1-t)
if ss%11 ==10:
testC='X'
else:
testC=str(ss%11)
if testC ==w[len(w)-1]:
print 'Right'
else:
c=w[0:-1]+testC
print c