def make_table
  i = 0
  j = 0
  table = Array.new(6)
  table.map!{Array.new(5)}

  "a".upto("z") do |c|
    table[i][j] = c
    j += 1
    i += 1 if j == 5
    j = 0  if j == 5
  end
  table[5][1] = '.'
  table[5][2] = '?'
  table[5][3] = '!'
  table[5][4] = ' '

  table
end

$table = make_table

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

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

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

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