readlines.each do |input|
  message = input.chomp

  if message.size.odd?
    puts "NA"
    next
  end

  message_int = []
  message.chars.map(&:to_i).map{|x| x-1}.each_slice(2){ |x| message_int << x }
  if message_int.map{ |set| 0 <= set.first && set.first <= 5 && 0 <= set.last && set.last <= 4 }.include?(false)
    puts "NA"
    next
  end

  table = Array.new(6)
  table.map!{Array.new(5)}
  int = 97
  0.upto(5) do |i|
    0.upto(4) do |j|
      if i == 5
        case j
        when 0
          table[i][j] = 'z'
        when 1
          table[i][j] = '.'
        when 2
          table[i][j] = '?'
        when 3
          table[i][j] = '!'
        when 4
          table[i][j] = ' '
        end
      else
        table[i][j] = int.chr
        int += 1
      end
    end
  end

  message_int.each { |set| print table[set.first][set.last] }
  puts ""

end