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;
int main() {
	string s;
	while (cin >> s){
		if (s.size() % 2 != 0) { 
			cout << "NA";
			goto P;
		}
		else 
			for (int i = 0; i < s.size(); i += 2){
			if (s[i] == '1'){
				if (s[i + 1] == '1')cout.put('a');
				else if (s[i + 1] == '2')cout.put('b');
				else if (s[i + 1] == '3')cout.put('c');
				else if (s[i + 1] == '4')cout.put('d');
				else if (s[i + 1] == '5')cout.put('e');
				else{
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '2'){
				if (s[i + 1] == '1')cout.put('f');
				else if (s[i + 1] == '2')cout.put('g');
				else if (s[i + 1] == '3')cout.put('h');
				else if (s[i + 1] == '4')cout.put('i');
				else if (s[i + 1] == '5')cout.put('j');
				else {
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '3'){
				if (s[i + 1] == '1')cout.put('k');
				else if (s[i + 1] == '2')cout.put('l');
				else if (s[i + 1] == '3')cout.put('m');
				else if (s[i + 1] == '4')cout.put('n');
				else if (s[i + 1] == '5')cout.put('o');
				else
				{
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '4'){
				if (s[i + 1] == '1')cout.put('p');
				else if (s[i + 1] == '2')cout.put('q');
				else if (s[i + 1] == '3')cout.put('r');
				else if (s[i + 1] == '4')cout.put('s');
				else if (s[i + 1] == '5')cout.put('t');
				else {
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '5') {
				if (s[i + 1] == '1')cout.put('u');
				else if (s[i + 1] == '2')cout.put('v');
				else if (s[i + 1] == '3')cout.put('w');
				else if (s[i + 1] == '4')cout.put('x');
				else if (s[i + 1] == '5')cout.put('y');
				else {
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '6'){
				if (s[i + 1] == '1')cout.put('z');
				else if (s[i + 1] == '2')cout.put('.');
				else if (s[i + 1] == '3')cout.put('?');
				else if (s[i + 1] == '4')cout.put('!');
				else if (s[i + 1] == '5')cout.put(' ');
				else
				{
					cout << "NA";
					goto P;
				}
			}
			else {
				cout << "NA";
				goto P;
			}
		}
	P:
		cout << endl;
	}
}

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

string s, r;

inline int cast(char c) {
	return (int)(c - '0');
}

int main(){
	bool fg;
	int a, b;
	while (cin >> s) {
		fg = false;
		r = "";
		if (s.size() % 2 != 0) {
			cout << "NA" << endl;
			continue;
		}
		for (int i = 0; i < s.size(); i += 2) {
			a = cast(s[i]), b = cast(s[i + 1]);
			if (a > 6 || b > 5) {
				fg = true;
				break;
			}
			if (a < 6) {
				r += ('a' + ((a - 1) * 5 + (b - 1)));
			}
			else {
				switch (b) {
				case 1:r += 'z';
					break;
				case 2:r += '.';
					break;
				case 3:r += '?';
					break;
				case 4:r += '!';
					break;
				case 5:r += ' ';
					break;
				default:break;
				}
			}
		}
		if (fg) {
			cout << "NA" << endl;
		}
		else {
			cout << r << endl;
		}
	}

	return 0;
}

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

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

map<string, char> mp;

int main(){
	for(int i=0;i<5;i++){
		for(int j=0;j<6;j++){
			stringstream ss;
			ss << (j + 1) << (i + 1);
			mp[ss.str()] = pat[i][j];
		}
	}

	string in;
	while(cin >> in){
		if(in.size() % 2 == 1){
			cout << "NA" << endl;
			continue;
		}
		string ret = "";
		for(int i=0;i<in.size();i+=2){
			string s = in.substr(i,2);
			if(mp.count(s) == 0){
				ret = "NA";
				break;
			} else {
				ret += mp[s];
			}
		}
		cout << ret << endl;
	}
	return 0;
}

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

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

int main(){
    string str;
    bool na;
    string result;

    while(cin >> str){
        result = "";
        na = false;
        if(str.size() % 2){
            na = true;
        }else{
            for(int i=0; i<str.size(); i+=2){
                int col = str.at(i) - '0' - 1;
                int row = str.at(i+1) - '0' - 1;
                if(col < 0 || col > 6 || row < 0 || row > 5){
                    na = true;
                }else{
                    result += table[col][row];
                }
            }
        }

        if(na == true){
            cout << "NA" <<endl;
        }else{
            cout << result << endl;
        }
    }

    return 0;
}

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

int main() {
	
	string table = "abcdefghijklmnopqrstuvwxyz.?! ",s,t;
	int i,l;
	
	while(cin>>s){
		l=s.length();
		t="";
		
		if(l%2)
			t="NA";
		else
			for(i=0;i<l;i+=2){
				if(s[i]<=54&&s[i]>=49&&s[i+1]<=53&&s[i+1]>=49)
					t += table[s[i]*5+s[i+1]-294];
				else{
					t="NA";break;
				}
			}
		cout<<t<<endl;
	}
	return 0;
}

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

using namespace std;

char META_CHARACTER[] = "z.?! ";

int main(void){
	for(string in, out; cin >> in; cout << out << endl){
		out.clear();
		if(in.length() % 2){ out = "NA"; continue; }

		for(int i = 0; i < in.length(); i += 2){
			int col = in.at(i) - '1';
			int row = in.at(i + 1) - '1';

			if(col > 5 || row > 4){ out = "NA"; break; }

			if(col == 5){ out.push_back(META_CHARACTER[row]); }
			else{ out.push_back('a' + 5 * col + row); }
		}
	}
		
		
	return 0;
}

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

int main(void)
{
	char buf[201],b[101];
	int i,a,flg;
	char moji[5][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',' '}};
	int len;
	int su1,su2;

	while(scanf("%s",buf)!=EOF)	{
		flg=1;
		len=strlen(buf);
		if(len%2==1)	flg=0;
		else {
			for(i=0;i<len/2;i++)	{
				su1=buf[i*2]-'0';
				su2=buf[i*2+1]-'0';
				if(su1<=0 || su1>6 || su2<=0 || su2>5)	{
					flg=0;
					break;
				}
//				printf("su2=%d su2=%d\n",su2,su1);
				b[i]=moji[su2-1][su1-1];
			}
			b[len/2]='\0';
		}
		if(flg==1)	{
			printf("%s\n",b);
		}
		else {
			printf("NA\n");
		}
	}
	return 0;
}

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

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

int main(){
  string s;
  while( cin >> s ){
    string ans;
    if( s.size() % 2 ){
      cout << "NA" << endl;
    }else{
      bool flag = false;
      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 >= 5 ){
	  flag = true;
	  break;
	}
	ans += table[y][x];
      }
      if( flag )
	cout << "NA" << endl;
      else
	cout << ans << endl;
    }
  }
}