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 <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <complex>
#include <sstream>
#include <stack>

using namespace std;

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

const char* strs = "abcdefghijklmnopqrstuvwxyz.?! ";

int main()
{
	char str[256];
	while(scanf("%s", str) != EOF){
		int n = strlen(str);
		char output[256] = {0};
		bool ok = true;
		for(int i=0; i<n; i+=2){
			if(i+1 == n){
				ok = false;
				break;
			}
			int a = str[i] - '1';
			int b = str[i+1] - '1';
			if(a<0 || 6<=a || b<0 || 5<=b){
				ok = false;
				break;
			}
			output[i/2] = strs[a*5+b];
		}
		
		puts(ok ? output : "NA");
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
    int tbl[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 code;
    while (cin >> code) {
        string converted = "";

        if (code.size() % 2 != 0) {
            converted = "NA";
        } else {
            for (int i=0; i<(int)code.size(); i+=2) {
                int a = code[i] - '0';
                int b = code[i+1] - '0';
                if (a >= 1 && a <= 6 && b >= 1 && b <= 5) {
                    converted += tbl[a-1][b-1];
                } else {
                    converted = "NA";
                    break;
                }
            }
        }

        cout << converted << endl;
    }
    return 0;
}

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

int main(){
	string s;
	while(cin>>s)
	{
		if(s.size()%2!=0){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0; i<s.size() ;i++)
		{
			int k;
			
			if(s[i]>'6' || s[i]<'1' || s[i+1]>'5' || s[i]<'1'){
				cout<<"NA";
				break;
			}
			
			k =  ((int)s[i]-48)*10;
			k += (int)s[i+=1]-48;
			
			if(k==65)cout<<" ";
			else if(k==64)cout<<"!";
			else if(k==63)cout<<"?";
			else if(k==62)cout<<".";
			else{
				if(k<=15){
					char c=k+86;
					cout<<c;
				}
				else if(k<=25){
					char c=k+81;
					cout<<c;
				}
				else if(k<=35){
					char c=k+76;
					cout<<c;
				}
				else if(k<=45){
					char c=k+71;
					cout<<c;
				}
				else if(k<=55){
					char c=k+66;
					cout<<c;
				}
				else cout<<"z";
			}
		}
		puts("");
	}

	return 0;
}

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

char getGlyph( int col, int row )
{
	if( col < 1 || col > 6 || row < 1 || row > 5 ){
		return '\0';
	}
	char glyph = '\0';
	if( col < 6 ){
		glyph = 'a' + ( col - 1 ) * 5 + ( row - 1 );
	}else{
		const char sign[] = { 'z', '.', '?', '!', ' ' };
		glyph = sign[ row - 1 ];
	}
	return glyph;
}

int main()
{
	char input[ 201 ];
	while( cin >> input ){
		bool failed = false;
		int len = strlen( input );
		int reader = 0;

		char output[ 201 ];
		int writer = 0;

		while( reader < len ){
			int col = input[ reader++ ] - '0';
			if( reader >= len ){
				failed = true;
				break;
			}
			int row = input[ reader++ ] - '0';
			char glyph = getGlyph( col, row );
			if( glyph == '\0' ){
				failed = true;
				break;
			}
			 output[ writer++ ] = glyph;
		}
		if( failed == true ){
			cout << "NA" << endl;
		}else{
			output[ writer ] = '\0';
			cout << output << 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()){
a="";
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>
#include<vector>
#include<string>
using namespace std;

int main() {
	string a;
	while (cin >> a) {
		cout << a.length() << endl;
		if (a.length() % 2 == 1) { cout << "NA" << endl; continue; }
		string t = "";
		bool p =true;
		for (int b = 0; b < a.length(); b += 2) {
			if (a[b] > '6' || a[b]<'1' || a[b + 1]>'5' || a[b + 1] < '1') { cout << "NA" << endl; p = false; break; }
			int s = (a[b] - 49) * 5 + (a[b + 1] - 49) + 97;
			if (s < 123)t += (char)s;
			else {
				switch (s) {
				case 123:t += '.'; break;
				case 124:t += '?'; break;
				case 125:t += '!'; break;
				case 126:t += ' '; break;
				}
			}
		}
		if (p)cout << t << endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	const char r[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 str;
		bool b = true;
		if (s.size() % 2 == 1) { b = false; }
		else for (int i = 0; i < s.size(); i += 2) {
			int a, bc;
			a = s[i] - '0';
			bc = s[i + 1] - '0';
			if (a >= 7 || bc >= 6){
				b = false;
			}
			else str += r[a - 1][bc - 1];
		}
		if (b){
			cout << str << endl;
		}
		else cout << "NA" << endl;
	}
}

C++: /*****include*****/
#include <iostream>
#include <string>
/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****変数置き場*****/
	string number;
	string num;
	char c_x;
	char c_y;
	int x;
	int y;
	bool fail;
	char table[6][7] = {
		{'0','0','0','0','0','0','0'},
		{'0','a','f','k','p','u','z'},
		{'0','b','g','l','q','v','.'},
		{'0','c','h','m','r','w','?'},
		{'0','d','i','n','s','x','!'},
		{'0','e','j','o','t','y',' '}
	};
	string answer;
	/*****処理部*****/
	while(1){
		cin >> number;
		if(cin.eof())	break;
		fail = false;
		answer = "";
		if(number.length()%2 != 0){
			fail = true;
		}else{
			for(int i=0;i<number.length();i+=2){
				num = number.substr(i,2);
				c_x = num[0];
				c_y = num[1];
				x = c_x - '0';
				y = c_y - '0';
				if(x<=0 || x>6 || y<=0 || y>5){
					fail = true;
					break;
				}
				answer.append(1,table[y][x]);
				//cout << table[y][x];
			}
		}
		if(fail)	cout << "NA" << endl;
		else
			cout << answer << endl;
	}
	/*****処理終了後*****/
	return 0;
}

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

int main(){
	string a;
while(cin>>a){
	if(a.length()%2){cout<<"NA"<<endl;continue;}
	for(int b=0;b<a.length();b+=2){
		if(a[b]<49||a[b]>54||a[b+1]<49||a[b+1]>53){cout<<"NA"<<endl;continue;}
		int s=(a[b]-49)*5+(a[b+1]-49);
	if(s+97<='z')	cout<<(char)(s+97);
	else{
		switch(s){
			case ('z'+1):cout<<'.';break;
			case ('z'+2):cout<<'?';break;
			case ('z'+3):cout<<'!';break;
			case ('z'+4):cout<<' ';break;
			}
		}
		}
		cout<<endl;
	}
}