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<bits/stdc++.h>
using namespace std ;

char table[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',' '}
} ;

main(){
	string s ;
	while( cin >> s ){
		if( cin.eof() ) break ;
		if( s.size() % 2 ){
			cout << "NA" << endl ;
			continue ;
		}
		bool t = false ;
		for( int i=0 ; i<s.size() ; i+=2 ){
			if( s[i]-'0' >= 1 && s[i]-'0' <= 6 &&
				s[i+1]-'0' >= 1 && s[i+1]-'0' <= 5 ){}
			else t = true ;
		}
		
		if( t ){
			cout << "NA" << endl ;
			continue ;
		}
		
		for( int i=0 ; i<s.size() ; i+=2 ) cout << table[s[i+1]-'0'-1][s[i]-'0'-1] ;
		cout << endl ;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  string nums,text,ch;
  ch = "abcdefghijklmnopqrstuvwxyz.?! ";
  while(cin>>nums){
    text = "";
    if(nums.size()%2){
      cout<<"NA"<<endl;
    }
    else{
      for(int i=0;i<nums.size()/2;i++){
    if('0'<nums[i*2]&&nums[i*2]<'7'&&'0'<nums[i*2+1]&&nums[i*2+1]<'6')
      text=text+ch[5*(nums[i*2]-49)+(nums[i*2+1]-49)];
    else{
      text="NA";
      break;
    }
      }
      cout<<text<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
string S, T; int a;
char c[101] = "00000000000abcde00000fghij00000klmno00000pqrst00000uvwxy00000z.?! 0000000000000000000000000000000000";
int main() {
	while (cin >> S) {
		T = "";
		if (S.size() % 2 == 1) {
			cout << "NA" << endl; goto E;
		}
		for (int i = 0; i < S.size() / 2; i++) {
			a = stoi(S.substr(i * 2, 2));
			if (c[a] == '0') { cout << "NA" << endl; goto E; }
			else { T += c[a]; }
		}
		cout << T << endl;
	E:;
	}
}

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