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 <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include<string>
#include <sstream>
using namespace std;

//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
string str;
char mozi[100];
string d;
int e;
int use;
char i ='a';
int main()
{
  for(int j = 1; j <=6;j++){
    for(int l = 1;l <=5;l++){
      if(j ==6&&l >=2)
	break;
      mozi[j*10+l] =i++;
	 }
      }
    mozi[62] ='.';
    mozi[63] ='?';
    mozi[64] ='!';
    mozi[65] =' ';
  while(cin>>str){
    use = 0;
    for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      if(e >65||e <11){
	cout <<"NA"<<endl;
	use = e;
	break;
      }
    }
    if(use ==0){
    for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      cout<<mozi[e];
    }
    cout <<endl;
  } 
  }
  return 0;
}

C++: #include <bits/stdc++.h>

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"] = ' ';
}
 
bool judge(string s)
{
    if (s.size()%2==1) return 0;
     
    for (int i = 0; i < (int)s.size(); i++) {
        if (i % 2 == 1 && !('1' <= s[i] && s[i] <='5')) return 0;
        if (i % 2 == 0 && !('1' <= s[i] && s[i] <= '6')) return 0;
    }
    return 1;
}
 
int main()
{
    string str;
     
    change();     
    while (cin >> str) {
        if (!judge(str)) {
            cout << "NA" << endl;
        } else {
            string ans = "";
            for (int i = 0; i < (int)str.size(); i++) {
                string k = str.substr(i, 2);
                if(i % 2 == 0) {
                    ans += m[k];
                }
            }
            cout << ans << endl;
        }
    }
    return 0;
}

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"] = ' ';
}

bool judge(string s){
    if(s.size()%2==1) return false;
    
    for(int i = 0 ; i < s.size(); i++){
        if(i%2==1 && !('1' <= s[i] && s[i] <='5')) return false;
        if(i%2==0 && !('1' <= s[i] && s[i] <= '6')) return false;
    }
    return true;
}

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

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007

char change(int a){
	if(a<26)return a+'a';
	if(a==26)return '.';
	if(a==27)return '?';
	if(a==28)return '!';
	if(a==29)return ' ';
	return '\0';
}



int main(){
	int a,b;
	string s;
	char c;
	while(cin>>s){
		string t;
		bool f=true;
		if(s.size()%2!=0)f=false;
		else{
			for(int i=0; i<s.size(); i+=2){
				a=s[i]-'1';
				b=s[i+1]-'1';
				if(a>5||b>4||a<0||b<0){
					f=false;
					break;
				}
				t+=change(a*5+b);
			}
		}
		cout<<(f?t:"NA")<<endl;
	}
	
}

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

int main(){
char w[8][7]={{"abcde"},{"fghij"},{"klmno"},{"pqrst"},{"uvwxy"},{"z.?! "}};
string st;
while(cin>>st){
	bool f=true;char W[200]={};

if(st.size()%2==1)cout<<"NA"<<endl;
else{
for(int i=0;i<(st.size());i+=2){
int x=st[i]-'0'-1;int y=st[i+1]-'0'-1;
W[i/2]=w[x][y];
if(x>4||x<0||y>4||y<0)f=false;
}

if(f==false)cout<<"NA"<<endl;
else cout<<W<<endl;
}
}
return 0;
}

C++: #include <iostream>

using namespace std;

/*

  1 2 3 4 5 6

1 a f k p u z

2 b g l q v .

3 c h m r w ?

4 d i n s x !

5 e j o t y  

*/

char conv(string str) {

	int c=str[0]-'0'-1, v=str[1]-'0'-1;

	if (c<5) {

		return 'a'+5*c+v;

	} else {

		switch (v) {

			case 0:

				return 'z';

			case 1:

				return '.';

			case 2:

				return '?';

			case 3:

				return '!';

			case 4:

				return ' ';

		}

	}

}

int main() {

	string mes;

	while (cin>>mes) {

		if (mes.length()%2!=0) cout << "NA" << endl;

		else {

			string temp="", res="";

			for (int i=0; i<mes.length(); i++) {

				if (i%2!=0) {

					temp += mes[i];

					res += conv(temp);

					temp = "";

				} else temp += mes[i];

			}

			cout << res << endl;

		}

	}

}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	char data[6][7]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
	string s;
	while(cin>>s){
		string ans;
		if(s.size()%2==1){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<s.size();i+=2){
			int x=s[i]-'1',y=s[i+1]-'1';
			ans+=data[x][y];
		}
		cout<<ans<<endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	char graph[6][7] = {{0,  0,  0,  0,  0,  0,  0},
											{0, 97,102,107,112,117,122},
											{0, 98,103,108,113,118,'.'},
											{0, 99,104,109,114,119,'?'},
											{0,100,105,110,115,120,'!'},
											{0,101,106,111,116,121,' '}};
	string s;
	while(cin >> s,!cin.eof()){
		string ans = "";
		if(s.size() % 2 == 1){cout << "NA" << endl;continue;};
		for(int i = 0;i < s.size();i += 2){
			if(s[i] - '0' <= 0 || s[i+1] - '0' <= 0 || s[i] - '0' > 6 || s[i+1] - '0' > 5){ans = "NA";break;}
			ans += graph[s[i+1]-'0'][s[i]-'0'];
		}
		cout << ans << endl;
	}	
}