#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<vector<int> > code(10, vector<int>(10, '*'));
    for(int i=0; i<26; ++i)
        code[i/5+1][i%5+1] = 'a' + i;
    code[6][2] = '.';
    code[6][3] = '?';
    code[6][4] = '!';
    code[6][5] = ' ';

    for(;;){
        string s;
        if(!(cin >> s))
            return 0;

        int n = s.size();
        if(n % 2 == 1){
            cout << "NA" << endl;
            continue;
        }

        string ret(n/2, ' ');
        bool na = false;
        for(int i=0; i<n; i+=2){
            char c = code[s[i]-'0'][s[i+1]-'0'];
            if(c == '*'){
                na = true;
                break;
            }
            ret[i/2] = c;
        }

        if(na)
            cout << "NA" << endl;
        else
            cout << ret << endl;
    }
}