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>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

char buf[300];
int main() {
	while (~scanf("%s", buf)) {
		char*s = buf;
		string res;
		while (s < buf + strlen(buf)) {
			int d; sscanf(s, "%2d", &d);
			if (d <= 10 || 65 < d) { puts("NA"); goto p; }
			if (d <= 15)res += char(d + 86);
			else if (d <= 25)res += char(d + 81);
			else if (d <= 35)res += char(d + 76);
			else if (d <= 45)res += char(d + 71);
			else if (d <= 55)res += char(d + 66);
			if (d == 61)res += 'z';
			if (d == 62)res += '.';
			if (d == 63)res += '?';
			if (d == 64)res += '!';
			if (d == 65)res += ' ';
			s += 2;
		}
		cout << res << endl;
	p:;
	}
}

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


int main(){
	char g[42] = {97,102,107,112,117,122,98,103,108,113,118,46,99,104,109,114,119,63,100,105,110,115,120,33,101,106,111,116,121,32};
	string s,a;
	while(cin >> s,!cin.eof()){
		a = "";
		for(int i = 0;i < s.size();i += 2){
				int l = s[i] - '0', r = s[i+1] - '0';
				if(s.size() % 2 || l < 1 || r < 1 || l > 6 || r > 5){a = "NA";break;}
			a += g[r * 6 + l - 7];
		}
		cout << a << endl;
	}	
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

int main(){
	string str;

	map<string,string> table;
	for(int y=1;y<=6;y++){
		for(int x=1;x<=5;x++){
			string key="";
			key = (char)(y+'0');
			key = key + (char)(x+'0');
			table[key]='a'+(x-1)+(y-1)*5;
		}
	}
	table["62"] = ".";
	table["63"] = "?";
	table["64"] = "!";
	table["65"] = " ";

	while(getline(cin,str)){

		string res="";
		for(int i=0;i<str.size();){
			if(table.find(str.substr(i,2)) != table.end()){
				res += table[str.substr(i,2)];
				i+=2;
			}
			else{
				res = "NA";
				break;
			}
		}

		cout << res << endl;
	}
}

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

const char symbol[4] = { '.', '?', '!', ' ' };

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		std::string res;
		bool f = true;

		if( s.size() & 1 )
			f = false;

		for( int i = 0; i < s.size(); i += 2 )
		{
			int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
			if( n > 29 )
				f = false;
			else
				res += n >= 26 ? symbol[n-26] : 'a' + n;

			if( !f )
				break;
		}
		
		std::cout << ( f ? res : "NA" ) << std::endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)

int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

char maze[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(void){
  string in;
  while(cin>>in){
    //cout<<in.size()<<endl;
    if(in.size()%2==0){
      rep(i,in.size()){
	cout<<maze[in[i+1]-'0'-1][in[i]-'0'-1];
	i ++;
      }
      cout<<endl;
    }else
      cout<<"NA"<<endl;
  }
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

string res[6] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};

const char OFS = '1';
int main()
{
    string s;
    while(getline(cin, s))
    {
        bool na = false;
        int l = s.size();

        if(l%2) na = true;
        s = s + "z";
        REP(l/2)
        {
            if(s[i * 2] >= '7' || s[i*2] == '0') na = true;
            if(s[i * 2 + 1] >= '6' || s[i*2] == '0') na = true;
        }
        if(na){ cout << "NA" << endl; continue;}
        
        REP(l/2) cout << res[(char)(s[i*2] - OFS)][(char)(s[i*2+1] - OFS)];
        cout << endl;

    }
    return 0;
}

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

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const char *data = "abcdefghijklmnopqrstuvwxyz.?! ";
int main(){
  string str;
  while(getline(cin,str)){
    string ans;
    int pos = 0;
    //printf("pos = %d, str.size()=%d\n",pos,str.size());
    while(true){
      if(pos != str.size()){
        if(pos + 1 == str.size())
          goto na;

        int a = str[pos++] - '0';
        int b = str[pos++] - '0';
        //printf("a = %d, b = %d\n",a,b);
        if(a < 1 || a > 6) goto na;
        if(b < 1 || b > 5) goto na;
        a--; b--;
        ans += data[a*5 + b];
      }else{
        cout << ans << endl;
        break;
      }
    }
    continue;
  na:
    cout << "NA" << endl;
  }
  return 0;
}

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

using namespace std;

char META_CHARACTER[] = "z.?! ";

int main(void){
	for(string in, out; cin >> in; cout << out << endl){
		out.clear();
		if(in.length() % 2){ out = "NA"; continue; }

		for(int i = 0; i < in.length(); i += 2){
			int col = (int)(in.at(i) - '1');
			int row = (int)(in.at(i + 1) - '1');

			if(col > 5 || row > 4){ out = "NA"; break; }

			if(col == 5){ out.push_back(META_CHARACTER[row]); }
			else{ out.push_back('a' + 5 * col + row); }
		}
	}
		
		
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    char u[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 s;
    while(cin>>s){
        bool flag=true;
        if(s.length()%2){cout<<"NA"<<endl; flag=false;}
    if(flag){
    vector<pii>v(1000);
    rep(i,s.length()/2){
        v[i]=pii(s[2*i]-48,s[2*i+1]-48);
        if(v[i].first>6||v[i].second>5){goto E;}
    }
    rep(i,s.length()/2)
    cout<<u[v[i].first-1][v[i].second-1];
    cout<<endl;
    }
    E:;
    }
}