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>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
using namespace std;

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

#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;

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();}
template<class T> void preview(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}

const int INF = 100000000;
const double PI = acos(-1.0), EPS = 1e-10;

char *dic = "abcdefghijklmnopqrstuvwxyz.?! ";

int main() {
	for(string line; cin >> line;) {
		if(line.length() & 1) {
			cout << "NA" << endl;
			continue;
		}
		bool ok = true;
		int n = line.length();
		for(int i = 0; i < n; i += 2) {
			int c = line[i] - '0';
			if(c > 6) ok = false;
			c = line[i + 1] - '0';
			if(c > 5) ok = false;
		}
		if(!ok) {
			cout << "NA" << endl;
			continue;
		}
		for(int i = 0; i < n; i += 2) {
			cout << dic[5 * (line[i] - '0' - 1) + (line[i + 1] - '0' - 1)];
		}
		cout << endl;
	}
	return 0;
}

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

int main()
{
    char a[5][6];
    for( int j = 0; j < 6; j++ )
        for( int i = 0; i < 5; i++ )
            a[i][j] = 'a' + i + j * 5;

    a[1][5] = '.';
    a[2][5] = '?';
    a[3][5] = '!';
    a[4][5] = ' ';

    string str;

    while( cin >> str )
    {
        if( str.size() % 2 != 0 )
            cout << "NA" << endl;
        else
        {
            string res = "";
            for( int i = 0; i < str.size() - 1; i += 2 )
            {
                if( 0 < str[i]-'0' && str[i] - '0' <= 6 && 0 < str[i+1]-'0' && str[i+1] - '0' <= 5 )
                    res += a[str[i+1]-'0'-1][str[i]-'0'-1];                                 //配列の添え字注意。列から行を見る。
                else
                {
                    res = "NA";
                    break;
                }
            }
            cout << res << endl;
        }
    }

    return 0;
}

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

char change(char a, char b) {
  char ans;
  if(a == '1' && b == '1') ans = 'a';
  if(a == '1' && b == '2') ans = 'b';
  if(a == '1' && b == '3') ans = 'c';
  if(a == '1' && b == '4') ans = 'd';
  if(a == '1' && b == '5') ans = 'e';
  if(a == '2' && b == '1') ans = 'f';
  if(a == '2' && b == '2') ans = 'g';
  if(a == '2' && b == '3') ans = 'h';
  if(a == '2' && b == '4') ans = 'i';
  if(a == '2' && b == '5') ans = 'j';
  if(a == '3' && b == '1') ans = 'k';
  if(a == '3' && b == '2') ans = 'l';
  if(a == '3' && b == '3') ans = 'm';
  if(a == '3' && b == '4') ans = 'n';
  if(a == '3' && b == '5') ans = 'o';
  if(a == '4' && b == '1') ans = 'p';
  if(a == '4' && b == '2') ans = 'q';
  if(a == '4' && b == '3') ans = 'r';
  if(a == '4' && b == '4') ans = 's';
  if(a == '4' && b == '5') ans = 't';
  if(a == '5' && b == '1') ans = 'u';
  if(a == '5' && b == '2') ans = 'v';
  if(a == '5' && b == '3') ans = 'w';
  if(a == '5' && b == '4') ans = 'x';
  if(a == '5' && b == '5') ans = 'y';
  if(a == '6' && b == '1') ans = 'z';
  if(a == '6' && b == '2') ans = '.';
  if(a == '6' && b == '3') ans = '?';
  if(a == '6' && b == '4') ans = '!';
  if(a == '6' && b == '5') ans = ' ';
  return ans;
}

int main(void) {
  char c[200];
  char ans[100];
  int len = 0;
  while(scanf("%s", c) != EOF) {
    int cnt = 0;
    len = strlen(c);
    for(int i = 0 ; i < len ; i+=2) {
      ans[i] = change(c[i], c[i+1]);
    }
    if(len % 2 == 0) {
      for(int i = 0 ; i < len ; i+=2) {
	cout << ans[i];
      }
      cout << endl;
    }
    else cout << "NA" << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	string A[] = { "abcde","fghij","klmno","pqrst","uvwxy","z.?! " };
	for (string s; cin >> s;) {
		if (s.size() % 2) {
			cout << "NA" << endl;
			continue;
		}
		bool flag = false;
		string ans = "";
		for (int i = 0; i < s.size(); i += 2) {
			if (!('1' <= s[i] && s[i] <= '6' && '1' <= s[i + 1] && s[i + 1] <= '5')) {
				cout << "NA" << endl;
				flag = true;
				break;
			}
			ans += A[s[i] - '1'][s[i + 1] - '1'];
		}
		if (flag) {
			continue;
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
	int x,y,f;
	string str;
	const char *table[] = {"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
	while(cin >> str){
		string t,tmp;
		f = 1;
		if(str.size() % 2 == 0){
			for(int i = 0;i < str.size();i += 2){
				tmp = str[i];
				x = atoi(tmp.c_str()) - 1;
				tmp = str[i+1];
				y = atoi(tmp.c_str()) - 1;
				if(x > 5 || y > 4 || x < 0 || y < 0){
					cout << "NA" << endl;
					f = 0;
					break;
				}
				if(f) t += table[x][y];
			}
			if(f) cout << t << endl;
		}
		else{
			cout << "NA" << endl;
		}
	}
	return 0;
}

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

using namespace std;

static inline int in(){ int x; scanf("%d", &x); return x; }

int main()
{
  string s;
  while (cin >> s){
    bool ok = true;
    for (int i = 0; i < s.size(); i++){
      if (i % 2 == 0){
        if (s[i] < '1' || '6' < s[i]){
          ok = false;
          break;
        }
      }
      else {
        if (s[i] < '1' || '5' < s[i]){
          ok = false;
          break;
        }
      }
    }
    if (s.size() % 2 == 1 || !ok){
      puts("NA");
      continue;
    }
    char *table[6] = {
      "abcde",
      "fghij",
      "klmno",
      "pqrst",
      "uvwxy",
      "z.?! "
    };
    for (int i = 0; i < s.size(); i += 2){
      printf("%c", table[s[i] - '1'][s[i + 1] - '1']);
    }
    puts("");
  }

  return 0;
}