Start: Jul, 06, 2019 10:00:00
20190706Python程序设计基础培训扩展练习
End: Jul, 17, 2019 12:00:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 48ms
Memory: 25316kB
Author: 13819973890
In contest: 1300

while True:
    try:
       lm=input().split('-')
       ln=lm[:-1]
       la=[]
       for n in ln:
           p=list(n)
           for t in p:
               la.append(int(t))
       total=0
       for k in range(len(la)):
            total+=(k+1)*la[k]

       total=total%11
       if total==10 and lm[-1]=='X':
           print('Right')
       elif  total==10 and lm[-1]!='X':
         lm[-1]='X'
         print("-".join(lm))
          
       elif str(total)==lm[-1]:
            print('Right')
       else:
         lm[-1]=str(total)
         print("-".join(lm))  
    except EOFError:
        break