import Data.Char
import Control.Applicative
page :: [(Int, Char)]
page = [
         (11, 'a'), (12, 'b'), (13, 'c'), (14, 'd'), (15, 'e')
       , (21, 'f'), (22, 'g'), (23, 'h'), (24, 'i'), (25, 'j')
       , (31, 'k'), (32, 'l'), (33, 'm'), (34, 'n'), (35, 'o')
       , (41, 'p'), (42, 'q'), (43, 'r'), (44, 's'), (45, 't')
       , (51, 'u'), (52, 'v'), (53, 'w'), (54, 'x'), (55, 'y')
       , (61, 'z'), (62, '.'), (63, '?'), (64, '!'), (65, ' ')
       ]

solver :: [String] -> [String]
solver [] = []
solver (x:xs) =
  if odd (length x)
    then "NA" : solver xs
  else
    converter x : solver xs

pager :: Int -> Char
pager n = snd . head $ filter (\x -> fst x == n) page

block :: String -> [Int]
block [] = []
block [_] = []
block (x:y:xs) =
  let a = digitToInt x
      b = digitToInt y
  in
      if a < 1 || 6 < a || b < 1 || 5 < b
        then -1 : block xs
      else
        10 * a + b : block xs

converter :: String -> String
converter xs =
  let ys = block xs
  in
      if -1 `elem` ys
        then "NA"
      else
        map pager ys

main :: IO()
main = do
  contents <- lines <$> getContents
  mapM_ putStrLn $ solver contents