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 <iostream>
#include <string>
#include <sstream>

using namespace std;


int main() {
  string str;
  while(getline(cin, str)) {
    stringstream sin;
    bool flag = true;
    if((int)str.length() % 2 == 0) {
      for(int i = 0; i < str.length(); i+=2) {
	int tm1 = (int)str[i] - (int)'0';
	int tm2 = (int)str[i+1] - (int)'0';

	if(!(tm1 >= 1 && tm1 <= 6 && tm2 >= 1 && tm2 <= 5)) {
	  flag = false;
	  break;
	}
	char c;
	if(tm1 == 6 && tm2 >= 2) {
	  switch(tm2) {
	  case 2:
	    c = '.'; break;
	  case 3:
	    c = '?'; break;
	  case 4:
	    c = '!'; break;
	  case 5:
	    c = ' '; break;
	  }
	} else {
	  c = (char)((tm1-1) * 5 + tm2 - 1 + (int)'a');
	}
	sin << c;
      }
    } else {
      flag = false;
    }

    if(!flag) {
      cout << "NA" << endl;
    } else {
      cout << sin.str() << endl;
    }
  }
  return 0;
}

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

char m[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','.','?','!',' '}
};

char f(int i, int j){
	return m[i][j];
}

int main(){
	string s;
	while( cin >> s ){
		string ans;
		bool flag = false;
		if( s.size()%2 ){
			flag = true;
		}else{
			for(int i=1 ; i < s.size() ; i+=2 ){
				int y = s[i-1]-'0'-1;
				int x = s[i]-'0'-1;
				if( y < 0 || x < 0 || y >= 6 || x >= 6 ){
					flag = true;
					break;
				}
				ans.push_back( f(y,x) );
			}
			if( flag )
				cout << "NA" << endl;
			else
				cout << ans << endl;
		}
	}
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	char mozi[5][7];
	//初期化
	strcpy(mozi[0],"afkpuz");
	strcpy(mozi[1],"bglqv.");
	strcpy(mozi[2],"chmrw?");
	strcpy(mozi[3],"dinsx!");
	strcpy(mozi[4],"ejoty ");
	//
	int cnt;
	char snum[]="0123456789";
	char svar[1000];
	
	scanf("%d",&cnt);
	for(int f1=0;f1<cnt;f1++){
		fflush(stdin);
		scanf("%s",svar);
		fflush(stdin);
		if(strlen(svar)%2==1)printf("NA\n");
		else{
			while(svar[0]!='0'){
				int x,y;
				for(int f2=0;f2<10;f2++){
					if(svar[0]==snum[f2]){
						y=f2-1;
					}
					if(svar[1]==snum[f2]){
						x=f2-1;
					}
				}
				//printf("svar->%s\n",svar);
				//printf("x->%d y->%d\n",x,y);
				for(int f=0;f<2;f++){
					for(int f2=0;f2<strlen(svar)-1;f2++){
						svar[f2]=svar[f2+1];	
					}
				}
				svar[strlen(svar)-1]='0';
				svar[strlen(svar)-2]='0';
				printf("%c",mozi[x][y]);
			}
			printf("\n");
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	string a="abcdefghijklmnopqrstuvwxyz.?! ";
	string b;
	while(cin>>b){
		if(b.length()%2==1) {
			cout<<"NA"<<endl;
			goto stop;
		}
		for(int i=0;i<b.length();i+=2){
			int c,d;
			c=(int)b[i]-'1';
			d=(int)b[i+1]-'0';
			int e=c*5+d;
			cout<<a[e-1];
		}
		cout<<endl;
		stop:;
	}
}

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

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	string alpha = "abcdefghijklmnopqrstuvwxyz.?! ";
	char table[5][6];

	int t = 0;
	rep(i,6)
	{
		rep(j,5)
		{
			table[j][i] = alpha[t];
			t++;
		}
	}
	
	string s;
	while(cin >> s)
	{
		if(s.size()%2 != 0)
		{
			cout << "NA" << endl;
		}
		else
		{
			t = 0;
			while(true)
			{
				if(t >= s.size())
				{
					break;
				}
			
				int a = s[t] - '1';
				int b = s[t+1] - '1';

				cout << table[b][a]; 
				t += 2;
			}
			cout << endl;
		}

		
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define pb push_back
#define mp make_pair
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

string mes, ans;
char hyou[6][7] = {
	{' ', ' ', ' ', ' ', ' ', ' ', ' '},
	{' ', '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', ' '}
};

int main()
{
	while (cin >> mes)
	{
		ans = "";

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

		for (int i=0; i<mes.length(); i++)
		{
			int first = mes[i] - '0';
			int second = mes[i+1] - '0';
			i++;

			if (!(1 <= first && first <= 6) || !(1 <= second && second <= 5))
			{
				ans = "NA";
				break;
			}

			ans += hyou[second][first];
		}

		cout << ans << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

string res[6];

const char OFS = '1';
int main()
{
    res[0] = "abcde";
    res[1] = "fghij";
    res[2] = "klmno";
    res[3] = "pqrst";
    res[4] = "uvwxy";
    res[5] = "z.?! ";

    string s;
    while(getline(cin, s))
    {
        bool na = false;
        int l = s.size();
        if(l%2) na = true;
        s += "z";
        REP(l/2)
        {
            if(s[i * 2] >= '7') na = true;
            if(s[i * 2 + 1] >= '6') na = true;
        }

        if(na){ cout << "NA" << endl; continue;}

        REP(l/2) cout << res[(char)(s[i*2] - OFS)][(char)(s[i*2+1] - OFS)];
        cout << endl;

    }
    return 0;
}

C++: #include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

char str[250];

int main()
{
  int i;
  char moji[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','.','?','!',' '}};

  while(scanf("%s",str)!=EOF){
    if(strlen(str)%2){
      cout<<"NA"<<endl;
      continue;
    }
    rep(i,strlen(str)/2){
      //      printf("str[%d]=%d\n",2*i,str[2*i]-'0');
      //      printf("moji[%d][%d]=%c\n",str[2*i]-'0',str[2*i+1]-'0',moji[str[2*i]-'0'][str[2*i+1]-'0']);
      cout<<moji[str[2*i]-'1'][str[2*i+1]-'1'];
    }
    cout<<endl;
  }

}

C++: #include <iostream>
#include <string>
using namespace std;
char m[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','.','?','!',' '},
};
int main()
{
  string s;
  while(cin >> s){
    int i,j,k,l = s.length();
    if(l % 2 == 1) {
      cout << "NA" << endl;
      continue;
    }
    char t[102];
    for(i=0; i<l/2; i++){
      j = s[i*2] - '0' - 1;
      k = s[i*2+1] - '0' - 1;
      if(j < 0 || k < 0 || j > 5 || k > 4) {
	cout << "NA" << endl;
	break;
      }
      t[i] = m[j][k];
    }
    if(i >= l/2) {
      t[i] = '\0';
      cout << t << endl;
    }
  }
  return 0;
}