#20452: python15行


allenphant11@gmail.com (王睿君)


try:
    while True:
        dic={1:'AMW',2:'KLY',3:'JXV',4:'HU',5:'GT',6:'FS',7:'ENR',8:'DQ',9:'CIPO',0:'BZN'}
        line=input()
        m=0
        n=8
        s=0
        while n>=1:
            s+=int(line[m])*n
            n-=1
            m+=1
        k=20-int(line[-1])
        print(dic[(k-s%10)%10])
except EOFError:
    pass
 
僅需要看個位數