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 <algorithm>
#include <string>

using namespace std;

int main ( void )
{
	string str;
	
	string hyo[] = { "abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! " };
	
	while (cin >> str)
	{
		if (str.size() % 2)
		{
			cout << "NA" << endl;
			continue;
		}
		
		string out = "";
		
		for (int i = 0, len = str.size(); i < len; i+=2)
		{
			int x, y;
			
			y = str[i] - '1';
			x = str[i+1] - '1';
			
			if (0 > x || x > 4 || 0 > y || y > 5)
			{
				out = "NA";
				break;
			}
			
			out += hyo[y][x];
		}
		
		cout << out << endl;
	}
	
	return 0;
}

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


int main(){
    char map[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){
	bool err = false;
	for (int i = 0; i < s.size(); i++){
	    if (i % 2 && s[i] > '5') err = true;
	    else if (i % 2 == 0 && s[i] > '6') err = true;
	}
	if (s.size() % 2 || err) cout << "NA" << endl;

	else {
	    for (int i = 0; i < s.size(); i+=2){
		cout << map[s[i]-'0'-1][s[i+1]-'0'-1];
	    }
	    cout << endl;
	}
    }
}

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;
	bool first = true;
	while(cin >> in){
		if(first){
			first = false;
		} else {
			cout << endl;
		}
		if(in.size() % 2 == 1){
			cout << "NA";
			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;
	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<cstdio>

using namespace std;

int main()
{
  char str[250];
  int i;
  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',' '}};
  while(scanf("%s",str)!=EOF){
    if(strlen(str)%2){
      cout<<"NA"<<endl;
      continue;
    }
    for(i=0;i<strlen(str);i++)
      cout<<moji[str[2*i+1]-'0'-1][str[2*i]-'0'-1];
    cout<<endl;

  }
}

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

int main(){
char moji[5][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',' '}};
    string s;
    while(cin >> s){
        for(int i=0;i<s.size();i+=2){
            if(s.size() % 2 != 0) {
                cout << "NA";
                break;
            }
            cout << moji[(s[i+1]%'0')-1][(s[i]%'0')-1];
        }
        cout << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (1<<21)

bool chk(char x,char y){
	return x>='1' && x <= '6' && y >= '1' && y <= '5';
}
string table[5] =
{
	"afkpuz",
	"bglqv.",
	"chmrw?",
	"dinsx!",
	"ejoty "
};
char get(char x,char y){
	x -= '1' , y -= '1';
	return table[y][x];
}
int main(){
	string str;
	while(cin >> str){
		bool f = 1;
		if(str.size() % 2) f = 0;
		for(int i=0;i<str.size();i+=2)
			f &= chk(str[i],str[i+1]);
		if(f){
			for(int i=0;i<str.size();i+=2)
				cout << get(str[i],str[i+1]);
			cout << endl;
		}else{
			cout << "NA" << endl;
		}
	}
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	char* table = "abcdefghijklmnopqrstuvwxyz.?! ";
	char buf[512];
	while (cin.getline(buf, sizeof(buf)), !feof(stdin))
	{
		if (strlen(buf) & 1)
		{
			puts("NA");
			continue;
		}

		char decode[256];
		memset(decode, 0, sizeof(decode));
		bool ok = true;
		for (int i = 0; buf[i] != '\0'; i += 2)
		{
			int c = buf[i] - '0' - 1;
			int r = buf[i+1] - '0' - 1;
			if (c < 0 || r < 0 || c > 5 || c > 5)
			{
				ok = false;
				break;
			}

			decode[i/2] = table[c*5 + r];
		}
		if (ok)
			puts(decode);
		else
			puts("NA");
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

char buf[300];
int main() {
	while (~scanf("%s", buf)) {
		char*s = buf;
		string res;
		while (s < buf + strlen(buf)) {
			int d; sscanf(s, "%2d", &d);
			if (d <= 10 || 65 < d) { puts("NA"); goto p; }
			if (d <= 15)res += char(d + 86);
			else if (d <= 25)res += char(d + 81);
			else if (d <= 35)res += char(d + 76);
			else if (d <= 45)res += char(d + 71);
			else if (d <= 55)res += char(d + 66);
			if (d == 61)res += 'z';
			if (d == 62)res += '.';
			if (d == 63)res += '?';
			if (d == 64)res += '!';
			if (d == 65)res += ' ';
			s += 2;
		}
		cout << res << endl;
	p:;
	}
}

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


int main(){
	char g[42] = {97,102,107,112,117,122,98,103,108,113,118,46,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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

int main(){
	string str;

	map<string,string> table;
	for(int y=1;y<=6;y++){
		for(int x=1;x<=5;x++){
			string key="";
			key = (char)(y+'0');
			key = key + (char)(x+'0');
			table[key]='a'+(x-1)+(y-1)*5;
		}
	}
	table["62"] = ".";
	table["63"] = "?";
	table["64"] = "!";
	table["65"] = " ";

	while(getline(cin,str)){

		string res="";
		for(int i=0;i<str.size();){
			if(table.find(str.substr(i,2)) != table.end()){
				res += table[str.substr(i,2)];
				i+=2;
			}
			else{
				res = "NA";
				break;
			}
		}

		cout << res << endl;
	}
}

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

const char symbol[4] = { '.', '?', '!', ' ' };

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		std::string res;
		bool f = true;

		if( s.size() & 1 )
			f = false;

		for( int i = 0; i < s.size(); i += 2 )
		{
			int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
			if( n > 29 )
				f = false;
			else
				res += n >= 26 ? symbol[n-26] : 'a' + n;

			if( !f )
				break;
		}
		
		std::cout << ( f ? res : "NA" ) << std::endl;
	}

	return 0;
}