Go: package main

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

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 <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;

int main() {
    //cout << fixed << setprecision(15);

    map<pair<int, int>, char> mp;

    for(int i=0; i<6; ++i){
        for(int j=0; j<6; ++j){
            mp[{i+1, j+1}] = ('a' + i*5+j);
        }
    }
    mp[{6, 1}] = 'z';
    mp[{6, 2}] = '.';
    mp[{6, 3}] = '?';
    mp[{6, 4}] = '!';
    mp[{6, 5}] = ' ';


    string s;
    while(cin >> s){
        if((int)s.size()%2==1) {
            cout << "NA" << endl;
            continue;
        }
        bool f = false;
        for(int i=0; i<s.size(); i+=2){
            if(mp.find({s[i]-'0', s[i+1]-'0'}) == mp.end()) f = true;
        }
        if(f){
            cout << "NA" << endl;
            continue;
        }
        for(int i=0; i<s.size(); i+=2){
            
            cout << mp[{s[i]-'0', s[i+1]-'0'}];
        }
        cout << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
main(){
char g[42]={97,102,107,112,117,122,98,103,108,113,118,146,99,104,109,114,119,63,100,105,110,115,120,33,101,106,111,116,121,32};
string s,a;
while(cin>>s,!cin.eof()){
for(int i=0;i<s.size();i+=2){
int l=s[i]-'0',r=s[i+1]-'0';
if(s.size()%2||l<1||r<1||l>6||r>5){a="NA";break;}
a+=g[r*6+l-7];
}
cout<<a<<endl;
}	
}

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 {

        switch (v) {

            case 0:

                return 'z';

            case 1:

                return '.';

            case 2:

                return '?';

            case 3:

                return '!';

            case 4:

                return ' ';

        }

    }
    return 1;

}

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==1) {
                        res = "NA";
                        break;
                    } else {
                        res += rchar;
                    }

                    temp = "";

                } else temp += mes[i];

            }

            cout << res << endl;

        }

    }

}

C++: #include<iostream>

using namespace std;

string str[6];

void make(){
  str[1] = "afkpuz";
  str[2] = "bglqv.";
  str[3] = "chmrw?";
  str[4] = "dinsx!";
  str[5] = "ejoty ";
}
int main(){
  make();
  string in;
  while(cin >> in){
    if(in.length()%2){
      cout << "NA" << endl;
      continue;
    }
    for(int i = 0; i < in.length(); i+=2){
      cout << str[(in[i+1]-'0')][(in[i]-'0'-1)];
    }
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(void){

  string s;

  char h[6][5] = {'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','.','?','!',' ' };
 back:
  while( cin >> s ){
    
    int l = s.size();
    if( l % 2 == 1 ){
      cout << "NA" << endl;
      continue;
    }
    
    int x[200],y[200],I = 0;
    for( int i = 0 ; i < l ; i += 2 ){
      x[I] = s[i] - '0';
      y[I] = s[i + 1] - '0';
      if( x[I] > 6 || y[I] > 5 || x[I] < 0 || y[I] < 0 ){
	cout << "NA" << endl;;
	goto back;
      }
      else{
	x[I]--;
	y[I]--;
      }
      I++;
    }
    for( int i = 0 ; i < I ; i++ ){
      cout << h[x[i]][y[i]];
    }
    cout << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stdlib.h>
using namespace std;
int main()
{
	string po[6] = { {},
	{ ' ', 'a', 'f', 'k', 'p', 'u', 'z' },
	{ ' ', 'b', 'g', 'l', 'q', 'v', '.' },
	{ ' ', 'c', 'h', 'm', 'r', 'w', '?' },
	{ ' ', 'd', 'i', 'n', 's', 'x', '!' },
	{ ' ', 'e', 'j', 'o', 't', 'y', ' ' } };
	string s;

	while (cin >> s){
		if (s.size() % 2 == 1){
			cout << "NA" << endl;
		}
		else{
			for (int i = 0; i < s.size(); i += 2){
				string x, y;
				x = s[i + 1];
				y = s[i];
				cout << po[stoi(x)][stoi(y)];
			}
		}
		cout << endl;
	}
}