编程小能手D @ 2022-01-19 23:10:47
def my_split(string):
num_List=[]
for s in string[:len(string)-2]:
try:
num_List.append(int(s))
except:
pass
return num_List,string[-1]
def get_tag(tList):
Sum=0
flag=1
for t in tList:
Sum+=t*flag
flag+=1
if Sum%11==10:
return 'X'
return str(Sum%11)
def get_trueString(numList,tag):
string=""
for i in range(len(numList)):
string+=str(numList[i])
if i==0 or i==3 or i==8:
string+="-"
string+=tag
return string
if __name__=="__main__":
string=input()
numList,tag=my_split(string)
Tag=get_tag(numList)
if Tag==tag:
print("Right",end="")
else:
print(get_trueString(numList,Tag),end="")