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<iostream>
using namespace std;
char M[6][6]={
	"abcde",
	"fghij",
	"klmno",
	"pqrst",
	"uvwxy",
	"z.?! "
};
string s;
main()
{
	while(cin>>s)
	{
		if(s.size()%2)
		{
			cout<<"NA"<<endl;
			continue;
		}
		bool f=1;
		for(int i=1;i<s.size();i+=2)if(!(s[i]>='1'&&s[i]<='5'))f=0;
		for(int i=0;i<s.size();i+=2)if(!(s[i]>='1'&&s[i]<='6'))f=0;
		if(!f)
		{
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<s.size();i+=2)
		{
			cout<<M[s[i]-'1'][s[i+1]-'1'];
		}
		cout<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int w,h;
  while(cin>>s){
    string ans ="";
    bool f = true;
    for(int i = 0; i < s.size();i+=2){
      w = s[i+1]-'0'-1;
      h = s[i]-'0'-1;
      if( !value(w,h,5,6)|| s.size() % 2){
        cout << "NA"<<endl;
        f = false;
        break;
      }
      ans += enc[w][h];
    }
    if(f) cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	char graph[42] = {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') * 7 + s[i]-'0'];
		}
		cout << ans << endl;
	}	
}

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

int main(){
	string s;
	while(cin >> s){
		if(s.size()%2!=0) {
			printf("NA\n");
			continue;
		}
		
		int now=0;
		
		while(now<s.size()){
			int a=s[now]-'0', b=s[now+1]-'0';
			int p=(a-1)*5+b-1;
			//printf("a,b,p=%d,%d,%d\n",a,b,p);
			
			if(p<=25) printf("%c", p+'a');
			else if(p==26) printf(".");
			else if(p==27) printf("?");
			else if(p==28) printf("!");
			else if(p==29) printf(" ");
			now+=2;	
		}
		
		printf("\n");
	}
	return 0;
}

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

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

const char* strs = "abcdefghijklmnopqrstuvwxyz.?! ";

int main()
{
	char str[256];
	while(scanf("%s", str) != EOF){
		int n = strlen(str);
		char output[256] = {0};
		bool ok = true;
		for(int i=0; i<n; i+=2){
			if(i+1 == n){
				ok = false;
				break;
			}
			int a = str[i] - '1';
			int b = str[i+1] - '1';
			if(a<0 || 6<=a || b<0 || 5<=b){
				ok = false;
				break;
			}
			output[i/2] = strs[a*5+b];
		}
		
		puts(ok ? output : "NA");
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
    int tbl[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 code;
    while (cin >> code) {
        string converted = "";

        if (code.size() % 2 != 0) {
            converted = "NA";
        } else {
            for (int i=0; i<(int)code.size(); i+=2) {
                int a = code[i] - '0';
                int b = code[i+1] - '0';
                if (a >= 1 && a <= 6 && b >= 1 && b <= 5) {
                    converted += tbl[a-1][b-1];
                } else {
                    converted = "NA";
                    break;
                }
            }
        }

        cout << converted << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <strstream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

int main(){
	string s;
	while(cin>>s)
	{
		if(s.size()%2!=0){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0; i<s.size() ;i++)
		{
			int k;
			
			if(s[i]>'6' || s[i]<'1' || s[i+1]>'5' || s[i]<'1'){
				cout<<"NA";
				break;
			}
			
			k =  ((int)s[i]-48)*10;
			k += (int)s[i+=1]-48;
			
			if(k==65)cout<<" ";
			else if(k==64)cout<<"!";
			else if(k==63)cout<<"?";
			else if(k==62)cout<<".";
			else{
				if(k<=15){
					char c=k+86;
					cout<<c;
				}
				else if(k<=25){
					char c=k+81;
					cout<<c;
				}
				else if(k<=35){
					char c=k+76;
					cout<<c;
				}
				else if(k<=45){
					char c=k+71;
					cout<<c;
				}
				else if(k<=55){
					char c=k+66;
					cout<<c;
				}
				else cout<<"z";
			}
		}
		puts("");
	}

	return 0;
}