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 <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

map<string, char> mp;

void init() {
  mp["11"] = 'a';
  mp["12"] = 'b';
  mp["13"] = 'c';
  mp["14"] = 'd';
  mp["15"] = 'e';
  mp["21"] = 'f';
  mp["22"] = 'g';
  mp["23"] = 'h';
  mp["24"] = 'i';
  mp["25"] = 'j';
  mp["31"] = 'k';
  mp["32"] = 'l';
  mp["33"] = 'm';
  mp["34"] = 'n';
  mp["35"] = 'o';
  mp["41"] = 'p';
  mp["42"] = 'q';
  mp["43"] = 'r';
  mp["44"] = 's';
  mp["45"] = 't';
  mp["51"] = 'u';
  mp["52"] = 'v';
  mp["53"] = 'w';
  mp["54"] = 'x';
  mp["55"] = 'y';
  mp["61"] = 'z';
  mp["62"] = '.';
  mp["63"] = '?';
  mp["64"] = '!';
  mp["65"] = ' ';
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  init();
  string s;
  while (cin >> s) {
    string ans = "";
    int sz = s.size(), na = sz & 1;
    for (int i = 0; i < sz; i += 2) {
      string t = s.substr(i, 2);
      na |= mp.find(t) == mp.end();
      ans += mp[s.substr(i, 2)];
    }
    cout << (na ? "NA" : ans) << endl;
  }

  return 0;
}

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

int main() {
	string s;
	while (cin >> s) {
		if (s.size() % 2) { puts("NA"); continue; }
		string res;
		int pos = 0;
		while (pos + 1 < s.size()) {
			int d = stoi(to_string(s[pos] - 48) + to_string(s[pos + 1] - 48));
			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 += ' ';
			pos += 2;
		}
		cout << res << endl;
	p:;
	}
}

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;

		if( f )
		{
			for( int i = 0; i < s.size(); i += 2 )
			{
				if( s[i] < '0' || s[i] > '9' || s[i+1] < '0' || s[i+1] > '9' )
				{
					f = false; 
					break;
				}

				int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
				if( n > 29 )
				{
					f = false;
					break;
				}
				else
					res += n >= 26 ? symbol[n-26] : 'a' + n;
			}
		}
		
		std::cout << ( f ? res : "NA" ) << std::endl;
	}

	return 0;
}

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;
}