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: 64ms
Memory: 25316kB
Author: shanzhenyu
In contest: 1300

while True:
    try:
        b = input()
        a = b.split("-")
        e = list(map(int,list("".join(a[:-1]))))
        for i in range(9):
            e[i] = e[i]*(i+1)
        total = sum(e)%11

        if a[-1] == "X":
            if total == 10:
                print("Right")
            else:
                print(b[:-1]+str(total))
        else:
            if a[-1] == str(total):
                print("Right")
            else:
                if total == 10:
                    print(b[:-1]+"X")
                else:
                    print(b[:-1]+str(total))

    except EOFError:
        break