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>
#include <string>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main(){
	int sum,x;
	string str;
	char abc[31]={"abcdefghijklmnopqrstuvwxyz.?! "};
	while(cin>>str){
		string ans="";
		int num=0;
		x=str.size();
		if(x%2!=0)cout<<"NA"<<endl;
		else{
			for(int i=0;i<x;i++){
				char c=str[i];
				if(i%2==1){
					sum=sum+(int)(c-'0');
					if(0<=sum&&sum<=30){
						ans+=abc[sum];
					}else{
						cout<<"NA"<<endl;
						num++;
						break;
					}
				}else{
					sum=(int)(c-'0');
					sum=(sum-1)*5-1;
				}
			}
			if(num==0){
				cout<<ans<<endl;
			}
		}
	}
	return 0;
}

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

int main()
{	
	string s;

	while (cin >> s) {
		string u;

		if (s.size() % 2 == 1)
			cout << "NA" << endl;
		else {
			for (int i = 0; i < (int)s.size(); i += 2) {

				int t = stoi(s.substr(i, 2));

				if (t / 10 < 1 || t / 10 > 6 || t % 10 > 5) {
					u = "NA";
					break;
				}

				t = t / 10 * 5 + t % 10 + 91;

				if (t == 123)
					t = 46;
				else if (t == 124)
					t = 63;
				else if (t == 125)
					t = 33;
				else if (t == 126)
					t = 32;

				u += (char)t;
			}
			cout << u << endl;
		}
	}

	return 0;
}

C++: #include<stdio.h>
#include<string>
using namespace std;
char moji[5][7]={
		"afkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty ",
};
char retu[401];
char mes[201];
void Encode(void){
	int i=0;
	int num1,num2;
	int cnt=0;
	int flg=0;
	while(retu[i]!='\0'){
		num1=retu[i]-49;
		if(retu[i+1]=='\0'){flg=1;break;}
		else{num2=retu[i+1]-49;}
		mes[cnt]=moji[num2][num1];
		cnt++;
		i+=2;
	}
	if(flg==1){
		printf("NA\n");
	}
	else{
		mes[cnt]='\0';
		printf("%s\n",mes);
	}
}
int main(void){
	int mes_num;
	scanf("%d",&mes_num);
	for(int i=0;i<mes_num;i++){
		scanf("%s",retu);
		Encode();
	}
	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

string enc[5] = {"afkpuz","bglqv.","chmrw?","dinsx!","ejoty "};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int w,h;
  while(cin>>s){
    string ans ="";
    bool f = true;
    for(int i = 0; i < s.size();i+=2){
      w = s[i+1]-'0'-1;
      h = s[i]-'0'-1;
      if( w >= 5 || h >= 6 || s.size() % 2){
        cout << "NA"<<endl;
        f = false;
        break;
      }
      ans += enc[w][h];
    }
    if(f) cout << ans << endl;
  }
  return 0;
}

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

int main()
{
	string table[6] = { "abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! " };
	string s;
	int a,b;
	while (cin>>s)
	{
		int flg = 0;
		string ans;
		if (s.size()%2)
		{
			cout << "NA" << endl;
		}
		else
		{
			for (int i = 0; i < s.size(); i += 2)
			{
				if ((s[i] >= '1') && (s[i] <= '6') && (s[i + 1] >= '1') && (s[i + 1] <= '5'))
				{
					a = s[i] - '0'-1;
					b = s[i + 1] - '0'-1;
					flg = 1;
					ans += table[a][b];
				}
			}
			if (flg)
			{
				cout << ans <<endl;
			}
			else
			{
				cout << "NA" <<endl;
			}
		}
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string str[6]={"","aafkpuz","abglqv.","achmrw?"
		 ,"adinsx!","aejoty "};
  string str2;
  while(cin>>str2){
    if(str2.size()%2==1)
      cout<<"NA"<<endl;
    else{
      for(int i=0;i<str2.size();i+=2){
	cout<<str[str2[i+1]-'0'][str2[i]-'0'];
      }
      cout<<endl;34
    }
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	string A[] = { "abcde","fghij","klmno","pqrst","uvwxy","z.?! " };
	for (string s; cin >> s;) {
		if (s.size() % 2) {
			cout << "NA" << endl;
			continue;
		}
		bool flag = false;
		string ans = "";
		for (int i = 0; i < s.size(); i += 2) {
			if (s[i] > '6' || s[i + 1] > '5') {
				cout << "NA" << endl;
				flag = true;
				break;
			}
			ans += A[s[i] - '1'][s[i + 1] - '1'];
		}
		if (flag) {
			break;
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<stdio.h>
char moji[5][7]={
		"afkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty ",
};
char retu[401];
char mes[201];
void Encode(void){
	int i=0;
	int num1,num2;
	int cnt=0;
	int flg=0;
	while(retu[i]!='\0'){
		num1=retu[i]-49;
		if(retu[i+1]=='\0'){flg=1;break;}
		else{num2=retu[i+1]-49;}
		mes[cnt]=moji[num2][num1];
		cnt++;
		i+=2;
	}
	if(flg==1){
		printf("NA\n");
	}
	else{
		mes[cnt]='\0';
		printf("%s\n",mes);
	}
}
int main(void){
	int mes_num;
	scanf("%d",&mes_num);
	for(int i=0;i<mes_num;i++){
		scanf("%s",retu);
		Encode();
	}
	return 0;
}