def splitstr(str,num):
    l =[]
    l = [str[i::num] for i in range(num)]
    l=["".join(i) for i in zip(*l)]
    rem = len(str) % num
    if rem: l.append(str[-rem:])
    return l
 
a = [[0 for i in range(5)] for j in range(6)]
q=97
for i in range(5):
    for j in range(5):
        a[i][j] = chr(q)
        q+=1
for i,j in enumerate('z.?! '): a[5][i] = j
def main():
    me=raw_input()
    me = splitstr(me,2)
    ans=""
    for i in me:
        ans+=a[int(i[0])-1][int(i[1])-1]
    print ans
if __name__ == '__main__':
    while True:
        try:
            main()
        except IndexError: print "NA";continue
        except EOFError: break
        except ValueError: print "NA"; continue