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<cstdio>
#include<cstring>
using namespace std;
int main(){
  char c[201];
  char hyou[6][7];
  hyou[1][6] = 'z';
  hyou[2][6] = '.';
  hyou[3][6] = '?';
  hyou[4][6] = '!';
  hyou[5][6] = ' ';
  for(int i=1;i<=5;i++){
    for(int j=1;j<=5;j++){
      hyou[i][j] = 'a'+(j-1)*5+i-1;
    }
  }
  
  while(scanf("%s",c) != EOF){
    if(strlen(c)%2 != 0){
      printf("NA\n");
      continue;
    }
    for(int i=0;i<strlen(c);i+=2){
      printf("%c",hyou[c[i+1]-'0'][c[i]-'0']);
    } putchar('\n');
  }

  return (0);
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

string ans, s;
string table[] = {  "afkpuz", "bglqv.",
"chmrw?", "dinsx!", "ejoty " };

int main(){
	while (cin >> s){
		bool f = 0;
		ans = "";
		if (s.size() % 2 != 0){
			cout << "NA" << endl;
			continue;
		}
		if (s.size() == 0)cout << "NA" << endl;
		for (int i = 0; i < s.size(); i += 2){
			if (s[i]>'6' || s[i]<'1' || s[i + 1]>'6' || s[i] < '1')f = 1;
			ans += table[s[i + 1] - '1'][s[i] - '1'];
		}
		if (f)cout << "NA" << endl;
		else cout << ans << endl;
		ans.clear();
	}
}

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

int main(){
	char p[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',' '}};
	string s;	
	while(cin >> s){
		bool flag = false;
		for(size_t i=0;i<s.size();i+=2){
			if(s[i]>'6' || s[i]<'1' || s[i+1]>'5' || s[i]<'1')
				flag = true;
		}
		if(flag||s.size()%2){
			cout << "NA" << endl;
		}else{
			for(size_t i=0;i<s.size();i+=2){
				cout << p[s[i+1]-'0'-1][s[i]-'0'-1];
			}
			cout << endl;
		}
	}
}

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

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	string str;
	char poke[5][7]={{"afkpuz"},{"bglqv."},{"chmrw?"},{"dinsx!"},{"ejoty "}};
	while(cin>>str){
		if(str.size()%2!=0)cout<<"NA"<<endl;
		else {
			string ans;
			bool kawa=0;
			for(int i=1;i<str.size();i+=2){
				if(str[i-1]-'1'>5||str[i]-'1'>5){
					kawa=1;
					break;
				}
				else ans+=poke[str[i]-'1'][str[i-1]-'1'];
			}
			if(kawa)cout<<"NA"<<endl;
			else cout<<ans<<endl;
		}
	}
}

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

map<string,int> m;

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

int main(){
    string str;
    
    change();
    
    while(cin >> str){
        if(str.size()%2==1) cout << "NA" << endl;
        else{
            string ans = "";
            for(int i = 0 ; i < str.size() ; i++){
                if('0' <= str[i] && str[i] <= '6'){
                    string k = str.substr(i,2);
                    if(i%2==0){
                        ans += m[k];
                    }
                }
                else{
                    cout << "NA" << endl;
                    goto end;
                }
            }
            cout << ans << endl;
        }
    end:;
    }
    
    return 0;
}

C++: #include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
char in[200]={'\0'};
char out[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 main(){
  while(cin>>in){
    int co=0;
    rep(i,200)if(in[i]!='\0')co++;
	if(co%2){cout<<"NA"<<endl;continue;}
	rep(i,co){
	  int a,b;
	  a=in[i]-'1';
	  i++;
	  b=in[i]-'1';
	  cout<<out[b][a];
	}
    cout<<endl;
	rep(i,co)in[i]='\0';
  }
}