while True:
try:
a=input().split('-')
b=''.join(a)
l=len(b)
iCount=1
iSum=0
for i in range(l-1):
iSum=iSum+int(b[i])*iCount
iCount+=1
if b[l-1]=='X':
if iSum%11==10:
print("Right")
else:
c=iSum%11
a[3]=str(c)
for i in range(3):
print(a[i],end='-')
if a[3]=='10':
print("X")
else:
print(a[3])
else:
if iSum%11==int(b[l-1]):
print("Right")
else:
c=iSum%11
a[3]=str(c)
for i in range(3):
print(a[i],end='-')
if a[3]=='10':
print("X")
else:
print(a[3])
except EOFError:
break