while True:
try:
t=map(str,raw_input().split('-'))
t1=''
rel=0
num=[1,2,3,4,5,6,7,8,9]
for i in range(0,3):
t1+=t[i]
for i in range(0,len(t1)):
rel=rel+int(t1[i])*num[i]
rel=rel%11
if rel==10:
s='X'
else:
s=str(rel)
xx=''
if t[-1]==s:
print 'Right'
else:
for i in range(0,3):
xx=xx+t[i]+"-"
print xx+s
except IOError:
pass