using System;

namespace Aizu
{
    class OnlineJudge
    {
        public static void Main()
        {
            string input;
            while((input = Console.ReadLine()) != null){
                if (input.Length % 2 == 1) {
                    Console.WriteLine("NA");
                }
                else {
                    char[] output = new char[input.Length / 2];
                    bool success = true;
                    for(int i=0; i < input.Length; i += 2){
                        int[] inputData = new [] { input[i] - '0' - 1, input[i + 1] - '0' - 1 };
                        if(inputData[0] < 6 && inputData[1] < 5) {
                            char addChar = (char)('a' + (inputData[0] * 5 + inputData[1]));
                            switch (addChar) {
                                case '{': addChar = '.'; break;
                                case '|': addChar = '?'; break;
                                case '}': addChar = '!'; break;
                                case '~': addChar = ' '; break;
                            }
                            output[i / 2] = addChar;
                        }
                        else {
                            success = false;
                            break;
                        }
                    }
                    Console.WriteLine(success ? new string(output) : "NA");
                }
            }
        }
    }
}