https://www.luogu.com.cn/problem/P1055
"""
P1055 [NOIP2008 普及组] ISBN 号码
https://www.luogu.com.cn/problem/P1055
"""
mod="0123456789X"
a=list(input())
#print(a)
t=0
j=1
for i in range(12):
if a[i]=='-':
continue
tmp=int(a[i])
#print(tmp)
t+=tmp*j
j+=1
#print(t)
s=t%11
'''
print("s=%d"%s)
if s==10:
x='X'
else:
x=str(s)
'''
#print(mod[s])
if mod[s]==a[12]:
print("Right")
else:
a[12]=mod[s]
#print(a)
for k in (a):
print(k,end='')