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])
			ret = append(ret, table[row-1][col-1])
		}
		fmt.Println(strings.Join(ret, ""))
	}
}

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

using namespace std;
char table[7][6];
int main(){
	int i,j,x,y;
	char a,b;
	string str;
	for(i = 1;i <= 6;i++){
		for(j = 1;j <= 5;j++){
			if(i == 1){
				if(j == 1) table[i][j] = 'a';
				else if(j == 2) table[i][j] = 'b';
				else if(j == 3) table[i][j] = 'c';
				else if(j == 4) table[i][j] = 'd';
				else if(j == 5) table[i][j] = 'e';
			}
			else if(i == 2){
				if(j == 1) table[i][j] = 'f';
				else if(j == 2) table[i][j] = 'g';
				else if(j == 3) table[i][j] = 'h';
				else if(j == 4) table[i][j] = 'i';
				else table[i][j] = 'j';
			}
			else if(i == 3){
				if(j == 1) table[i][j] = 'k';
				else if(j == 2) table[i][j] = 'l';
				else if(j == 3) table[i][j] = 'm';
				else if(j == 4) table[i][j] = 'n';
				else table[i][j] = 'o';
			}
			else if(i == 4){
				if(j == 1) table[i][j] = 'p';
				else if(j == 2) table[i][j] = 'q';
				else if(j == 3) table[i][j] = 'r';
				else if(j == 4) table[i][j] = 's';
				else table[i][j] = 't';
			}
			else if(i == 5){
				if(j == 1) table[i][j] = 'u';
				else if(j == 2) table[i][j] = 'v';
				else if(j == 3) table[i][j] = 'w';
				else if(j == 4) table[i][j] = 'x';
				else table[i][j] = 'y';
			}
			else {
				if(j == 1) table[i][j] = 'z';
				else if(j == 2) table[i][j] = '.';
				else if(j == 4) table[i][j] = '!';
				else if(j == 3) table[i][j] = '?';
				else table[i][j] = ' ';
			}
		}
	}
	while(cin >> str){
		if(str.size() % 2 == 0){
			for(i = 0;i < str.size();i += 2){
				a = str[i];
				b = str[i+1];
				x = (int)(a - '0');
				y = (int)(b - '0');
				cout << table[x][y];
			}
			cout << "\n";
		}
		else{
			cout << "NA" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	const char TABLE[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','.','?','!',' '}};
	string s;
	while(cin>>s){
		string ans="";
		for(int i=0;i<s.size();i+=2){
			if(s[i]>='1'&&s[i]<='6'&&s[i+1]>='1'&&s[i+1]<='5'&&i+1<s.size()){
				ans+=TABLE[s[i]-'0'-1][s[i+1]-'0'-1];
			}else{
				ans="NA";
				break;
			}
		}
		cout<<ans<<"\n";
	}
	return 0;
}

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

string mp[6] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! " };

int main() {
    string s;
    while(cin>>s) {
        if(s.length()%2) {
            cout<<"NA"<<endl;
            continue;
        }

        string res = "";
        for(int i=0; i<s.length(); i+=2) {
            if(s[i] >= '7' || s[i] <= '0' || s[i+1] >= '6' || s[i+1] <= '0') {
                cout<<"NA"<<endl;
                goto NEXT;
            }
            res += string(1, mp[s[i]-'1'][s[i+1]-'1']);
        }

        cout<<res<<endl;
    NEXT:;
    }
}

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

using namespace std;

int main(){

	char table[20][20];
	string str;

	for(int i = 1; i <= 6; i++){
		for(int j = 1; j <= 5; j++){
			table[j][i]='a'+5*(i-1)+(j-1);
			if(i==6&&j==1)
				break;
		}
		if(i==6){
			table[2][6]='.';
			table[3][6]='?';
			table[4][6]='!';
			table[5][6]=' ';
		}
	}

	while(cin>>str){
		if(str.size()%2==1){
			cout<<"NA"<<endl;
			continue;
		}
		bool f=false;
		string cs;
		for(int i = 0; i < str.size(); i+=2){
			if(str[i]>='1'&&str[i]<='6'&&str[i+1]>='1'&&str[i+1]<='6'){
				cs+=table[str[i+1]-'0'][str[i]-'0'];
			}
			else{
				f=true;
				cout<<"NA"<<endl;
				break;
			}
		}
		if(f)
			continue;
		else{
			cout<<cs<<endl;
		}
	}

	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;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  char zu[8][9];
  string bun;
  char x='a';
  int nagasa;
  int smp1,smp2;
  for(int i=0;i<6;i++){
    for(int j=0;j<5;j++){
      zu[i][j] = x;
      x++;
    }
  }
  zu[5][1]='.';
  zu[5][2]='?';
  zu[5][3]='!';
  zu[5][4]=' ';
  cin >> bun;
  nagasa = bun.size();
  int flag=0;
  for(int i=0;i<nagasa;i=i+2){
    smp1 = bun[i]-'0'-1;
    smp2 = bun[i+1]-'0'-1;
    if(smp1 > 5 || smp2 > 4){
      flag = 1;
    }
  }
  int a = nagasa%2;
  if(a == 0 && flag == 0){
    for(int i=0;i<nagasa;i=i+2){
      smp1 = bun[i]-'0'-1;
      smp2 = bun[i+1]-'0'-1;
      cout << zu[smp1][smp2];
    }
    cout << endl;
  }
  else{
    cout << "NA" << endl;
  }
}

C++: #include <stdio.h>
#include <string.h>
char c[201], d[101];
int main() {
	while (~scanf("%s", c)) {
		if (strlen(c) % 2 == 1) {
			printf("NA\n");
		}
		else {
			bool flag = false;
			for (int i = 0; i < strlen(c); i += 2) {
				int a = c[i] - 48, b = c[i + 1] - 48;
				if (a == 0 || a > 6 || b == 0 || b > 5) {
					printf("NA"); flag = true; break;
				}
				else {
					int e = (a - 1) * 5 + (b - 1);
					switch (e) {
					case 26: d[i / 2] = '.'; break;
					case 27: d[i / 2] - '?'; break;
					case 28: d[i / 2] = '!'; break;
					case 29: d[i / 2] = ' '; break;
					default: d[i / 2] = (char)(e + 97);
					}
				}
			}
			if (!flag) {
				for (int i = 0; i < strlen(c) / 2; i++) {
					printf("%c", d[i]);
				}
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
 char a[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','.','?','!',' '} };
 string b;
 while (cin >> b) {
  string c = "";
  if (b.length() % 2 == 1) {
   cout << "NA" << endl;
   goto stop;
  }
  int h, w;
  for (int i = 0; i < b.length() ; ) {
   h = (int)b[i++] - '0';
   w = (int)b[i++] - '0';
   if (h > 6 || w > 5) {
    cout << "NA" << endl;
    goto stop;
   }
   h--; w--;
   c += a[h][w];
   h = 0; w = 0;
  }
  cout << c << endl;
  stop:;
 }
}