table = ((?a..?z).to_a + [?., ??, ?!, " "]).each_slice(5).to_a
while gets
    a = $_.chomp.split("").map(&:to_i).each_slice(2).to_a
    ans = ""
    a.each do |i, j|
        if !j || !(1..6).include?(i) || !(1..5).include?(j)
            ans = 'NA'
            break
        end
        ans += table[i-1][j-1]
    end
    puts ans
end