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 <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[66];
string d;
int e;
int use;
char i ='a';
bool flag;
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){
    string ans;
    if(str.size()%2){
      cout <<"NA"<<endl;
    }else{
      flag = false;
      for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      ans +=mozi[e];
      if(e <11||e >65){
	flag = true;
	break;
      }
      }
      if(flag)
	cout <<"NA"<<endl;
      else
	cout <<ans<<endl;;
    }
  }
  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){
		ans = "";
		if (s.size() % 2 == 1){
			cout << "NA" << endl;
			continue;
		}
		for (int i = 0; i < s.size(); i += 2){
			ans += table[s[i + 1] - '0'][s[i] - '0'];
		}
		cout << ans << endl;
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>

int main(){
	char 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', '.', '?', '!', ' '}};
	
	char m[1000];
	char om[1000];
	
	while(scanf("%s", m) != EOF){
		int len = strlen(m);
		if(len % 2 == 0){
			int j = 0;
			bool na = false;
			for(int i = 0; i < len-1; i+=2){
				int c, c1;
				c = m[i] - '0';
				c1 = m[i+1] - '0';
				if(c < 1 || c > 6 || c1 < 1 || c1 > 5){
					na = true;
					break;
				}
				om[j] = tbl[c-1][c1-1];
				j++;
			}
			if(na){
				printf("NA");
			}else {
				for(int i = 0; i < j; i++){
					printf("%c", om[i]);
				}
			}
			putchar('\n');
		}else {
			printf("NA\n");
		}
	}
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;

int main() {
    //cout << fixed << setprecision(15);

    map<pair<int, int>, char> mp;

    for(int i=0; i<6; ++i){
        for(int j=0; j<6; ++j){
            mp[{i+1, j+1}] = ('a' + i*5+j);
        }
    }
    mp[{6, 1}] = 'z';
    mp[{6, 2}] = '.';
    mp[{6, 3}] = '?';
    mp[{6, 4}] = '!';
    mp[{6, 5}] = ' ';


    string s;
    while(cin >> s){
        if((int)s.size()%2==1) {
            cout << "NA" << endl;
            continue;
        }

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

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

using namespace std;

int main(int argc, char const* argv[])
{
	string data;
	string output;

START:
	while( cin >> data ){
		output.clear();
		if( data.size() % 2 ){
			cout << "NA" << endl;
			continue;
		}

		for( int i = 0;i < data .size() / 2;i++ ){
			int j = i * 2;
			data[j] -= '0';
			data[j + 1] -= '0';
			if( data[j] < 1 || data[j + 1] < 1 || data[j] > 6 || data[j + 1] > 5 ){
				cout << "NA" << endl;
				goto START;
			}
			if( data[j] == 6 && data[j + 1] > 1 ){
				if( data[j + 1] == 2 ) output.append(1,'.');
				else if( data[j + 1] == 3 ) output.append(1,'?');
				else if( data[j + 1] == 4 ) output.append(1,'!');
				else if( data[j + 1] == 5 ) output.append(1,' ');
			} else {
				char a = ( data[j] - 1 ) * 5 + data[j + 1] - 1 + 'a';
				output.append(1,a);
			}
		}
		cout << output <<  endl;
	}


	
	return 0;
}