Start: Nov, 12, 2017 10:00:00
2017秋Python程序设计基础培训第四次作业
End: Nov, 19, 2017 12:00:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 113ms
Memory: 24436kB
Author: zzzhanghc
In contest: 1124

def check(li):
    s=0
    t=0
    for i in range(len(li)-1):
        if li[i] == '-':
            t=t+1
        else:
            s+=int(li[i])*(i+1-t)
    if s % 11==10:
        a='X'
    else:
        a=str(s % 11)
    if a==li[-1]:
        return 'Right'
    else:
        return li[0:12]+a

while True:
    try:
        s=input()
        print(check(s))
    except EOFError:
        break