while True:
try:
str1=raw_input()
n=len(str1)
t=1
s=0
for i in range(n-1):
if str1[i]>="0" and str1[i]<="9":
s+=int(str1[i])*t
t+=1
s=s%11
if s==10:
if str1[-1]=="X":
print "Right"
else:
print str1[0:12]+"X"
else:
if str1[-1]=="X":
print str1[0:12]+str(s)
else:
if s==int(str1[-1]):
print "Right"
else:
print str1[0:12]+str(s)
except EOFError:
break