Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
		"strconv"
	)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	table := [6][5]string{
		{"a", "b", "c", "d", "e"},
		{"f", "g", "h", "i", "j"},
		{"k", "l", "m", "n", "o"},
		{"p", "q", "r", "s", "t"},
		{"u", "v", "w", "x", "y"},
		{"z", ".", "?", "!", " "},
	}
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), "")
		if len(input) % 2 != 0 {
			fmt.Println("NA")
			continue
		}
		ret := make([]string, 0)
		for i := 0; i < len(input); i += 2 {
			row, _ := strconv.Atoi(input[i])
			col, _ := strconv.Atoi(input[i+1])
			// log.Println(table[row-1][col-1])
			ret = append(ret, table[row-1][col-1])
		}
		fmt.Println(strings.Join(ret, ""))
	}
}

C++: #include <iostream>

using namespace std;

/*

  1 2 3 4 5 6

1 a f k p u z

2 b g l q v .

3 c h m r w ?

4 d i n s x !

5 e j o t y  

*/

char conv(string str) {

    int c=str[0]-'0'-1, v=str[1]-'0'-1;

    if (c<5) {

        return 'a'+5*c+v;

    } else if (c==5) {

        switch (v) {

            case 0:

                return 'z';

            case 1:

                return '.';

            case 2:

                return '?';

            case 3:

                return '!';

            case 4:

                return ' ';

        }

    } else {
        return '0';
    }

}

int main() {

    string mes;

    while (cin>>mes) {

        if (mes.length()%2!=0) cout << "NA" << endl;

        else {

            string temp="", res="";

            for (int i=0; i<mes.length(); i++) {

                if (i%2!=0) {

                    temp += mes[i];

                    char rchar = conv(temp);
                    if (rchar=='0') {
                        res = "NA";
                        break;
                    } else {
                        res += rchar;
                    }

                    temp = "";

                } else temp += mes[i];

            }

            cout << res << endl;

        }

    }

}

C++: #include <iostream>
#include <string>
using namespace std;

int main() {
    string input;
    while (cin >> input) {
        if ((int) input.length() % 2 != 0) {
            cout << "NA" << endl;
            continue;
        }
        bool NAFlag = false;
        string output;
        while (input.length() > 0) {
            switch (input[0]) {
            case '1':
                output += 'a' + (input[1] - '0') - 1;
                break;
            case '2':
                output += 'f' + (input[1] - '0') - 1;
                break;
            case '3':
                output += 'k' + (input[1] - '0') - 1;
                break;
            case '4':
                output += 'p' + (input[1] - '0') - 1;
                break;
            case '5':
                output += 'u' + (input[1] - '0') - 1;
                break;
            case '6':
                switch (input[1]) {
                case '1':
                    output += 'z';
                    break;
                case '2':
                    output += '.';
                    break;
                case '3':
                    output += '?';
                    break;
                case '4':
                    output += '!';
                    break;
                case '5':
                    output += ' ';
                    break;
                default:
                    NAFlag = true;
                    break;
                }
                break;
            default:
                NAFlag = true;
                break;
            }
            if (NAFlag) {
                cout << "NA" << endl;
                continue;
            }
            input.erase(0, 2);
        }
        cout << output << endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(void){
	const char *table[] ={
		"afkpuz",
		"bglqv.",
		"chmrw\?",
		"dinsx!",
		"ejoty "
	};

	int n;
	cin >> n;
	for( int D = 0; D < n; ++D ){
		bool bNA = false;
		string s;

		cin >> s;
		if( s.length() % 2 == 1 ){
			bNA = true;
			goto NA;
		}
		for(unsigned int l = 0; l < s.length(); l += 2){
			int i = s[l+1]-'0'-1;
			int j = s[l]-'0'-1;
			if( !(0 <= i && i <= 5) || !(0 <= j && j <= 5) ){
				bNA = true;
				goto NA;
			}
		}
NA:;
		if( bNA ){
			cout << "NA\n";
			continue;
		}

		for(unsigned int l = 0; l < s.length(); l += 2){
			int i = s[l+1]-'0'-1;
			int j = s[l]-'0'-1;
			cout << table[i][j];
		}
		cout << '\n';
	}

	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;


char decode(int a,int b){
	int x=a*5+b;
	if(x<26)return x+'a';
	return ".?! "[x-26];
}

int main(){
	string s;
	while(cin>>s){
		bool f=true;
		string res;
		if(s.size()%2){
			f=false;
		}
		for(int i=0;f&&i<s.size();i+=2){
			if('1'<=s[i]&&s[i]<='6' && '1'<=s[i+1]&&s[i+1]<='5'){
				res+=decode(s[i]-'1',s[i+1]-'1');
			}else f=false;
		}
		if(f)cout<<res;
		else cout<<"NA";
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stack>
#include<cstdio>
#include<map>
#include<functional>

using namespace std;

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>

using namespace std;

int main(){
	string s;
	int n;
	char mozi[10][10] = {"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
    bool flag=true;
    
    cin>>n;
	for(int i=0; i<n; i++)
	{
		cin>>s;
		if(s.size()%2==1)
		{
			puts("NA");
			continue;
		}
		else
		{
			char str[201],kari[200];
			long int length = s.length();
			s.copy(str,length,0);
			for(int i=0; i<s.size(); i+=2)
			{
                if(0 <= (int)str[i]-49 <= 5 && 0 <= (int)str[i+1]-49 <= 4)
                    kari[i]=mozi[ (int)str[i]-49 ][ (int)str[i+1]-49 ];
                else
                    flag=false;
			}
            if(flag==true)
            {
                for(int i=0; i<s.size(); i+=2)
                {
                    cout<<kari[i];
                }
            }
            else
            {
                cout<<"NA";
            }
            puts("");
		}
    }
	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  string t[] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};
  string s;
  while (cin >> s) {
    if (odd(s.size())) {
      cout << "NA" << endl;
      continue;
    }
    stringstream ss;
    for (int i = 0; i < s.size(); i += 2) {
      ss << t[s[i] - '1'][s[i + 1] - '1'];
    }
    cout << ss.str() << endl;
  }
}