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 <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <vector>
#include <sstream>
#include <functional>
using namespace std;
char table[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','.','?','!',' '},
};
int main()
{
	string s;
    while(cin>>s){
		if(!(s.length()%2)){
			for(int i=0;i<(int)s.length();i+=2){
				if(1<=s[i]-'0'&&s[i]-'0'<=6&&1<=s[i+1]-'0'&&s[i+1]-'0'<=5){
					cout<<table[s[i]-'0'-1][s[i+1]-'0'-1];
				}else{
					cout<<"NA";
					break;
				}
			}
		}else{
			cout<<"NA";
		}
		cout<<endl;
	}
    return 0;
}

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

string hyou[] = {"afkpuz",
		 "bglqv.",
		 "chmrw?",
		 "dinsx!",
		 "ejoty "};
int main(){
  string in;
  while(cin >> in){
    if(in.size()%2 == 1){
      cout << "NA" << endl;
      continue;
    }
        for(int i = 0 ; i < in.size() ; i+=2 ){
	  cout << hyou[in[i+1]-'0'-1][in[i]-'0'-1];
    }
	cout << endl;
  }
  return 0;
}

C++: #include <iostream> 
#include <vector>
using namespace std;
int main(){
  char m = 'a';
  vector<char> str(31);
  for(int i = 1;i < 26;i++){
    str[i] = 'a' + i-1;
  }
  str[27] = '.';
  str[28] = '?';
  str[29] = '!';
  str[30] = ' ';
  string line;
  while(cin >> line){
    if(line.size()%2 != 0){
      cout << "NA" << endl;
      continue;
    }
    for(int i = 0;i < line.size();i+=2){
      int tmp = (line[i+1]-'0')+((line[i]-'0'-1)*5);

      cout << str[tmp];
    }
    cout << endl;
  }


  return 0;
}

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

int main(){
    char field[6][11];
    char a='a';
    for(int i=1; i < 7; i++){
        for(int j=1; j < 6; j++){
            field[j][i] = a;
            a++;
        }
    }
    field[2][6] = '.'; field[3][6] = '?'; field[4][6] = '!'; field[5][6] = ' ';

    string input;
    while(cin >> input){
        if(input.size()%2 == 1) {
            cout << "NA" << endl;
            continue;
        }
        for(int i=0; i < input.size(); i+=2){
            int n = atoi(input.substr(i, 1).c_str());
            int m = atoi(input.substr(i+1, 1).c_str());

            cout << field[m][n];
        }
        cout << endl;
    }
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	string s;
	while (cin >> s) {
		if (s.size() % 2) { puts("NA"); continue; }
		string res;
		int pos = 0;
		while (pos + 1 < s.size()) {
			int d = stoi(to_string(s[pos] - 48) + to_string(s[pos + 1] - 48));
			if (d <= 10 || 65 < d) { puts("NA"); goto p; }
			else if (10 < d&&d <= 15)res += (char)d + 86;
			else if (20 < d&&d <= 25)res += (char)d + 81;
			else if (30 < d&&d <= 35)res += (char)d + 76;
			else if (40 < d&&d <= 45)res += (char)d + 71;
			else if (50 < d&&d <= 55)res += (char)d + 66;
			else if (d == 61)res += 'z';
			else if (d == 62)res += '.';
			else if (d == 63)res += '?';
			else if (d == 64)res += '!';
			else if (d == 65)res += ' ';
			else { puts("NA"); goto p; }
			pos += 2;
		}
		cout << res << endl;
	p:;
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    string s, ans;
    while(cin >> s){
        int i = 0;
        char a;
        ans = "";
        while(i < s.size()){
            if(s.size() % 2 || (s[i] > '6' || s[i + 1] > '5')){
                ans = "NA";
                break;
            }
            if(s[i] == '1'){
                a = ('a' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '2'){
                a = ('f' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '3'){
                a = ('k' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '4'){
                a = ('p' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '5'){
                a = ('u' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '6'){
                if(s[i + 1] == '1')
                    a = 'z';
                else if(s[i + 1] == '2')
                    a = '.';
                else if(s[i + 1] == '3')
                    a = '?';
                else if(s[i + 1] == '4')
                    a = '!';
                else if(s[i + 1] == '5')
                    a = ' ';
            }
            ans+= a;
            i+= 2;
        }
        cout << ans << endl;
    }
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>

using namespace std;

int main() {
	char h[6][6]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "},c[202];
	int i,n;
	while(cin >> c) {
    n=strlen(c);
	for (i=0;i<n-1;i+=2) if (c[i]<'1' || c[i]>'6' || c[i+1]<'1' || c[i+1]>'5') break;
	if ((n % 2!=0) || (i!=n)) { cout << "NA" << endl; continue;} 
	for (i=0;i<n-1;i+=2) cout << h[c[i]-'0'-1][c[i+1]-'0'-1];
	cout << endl;
	}
 return 0;
}

C++: /*
	0127:Pocket Pager Input
*/
#include	<iostream>
#include	<string>

using namespace std;

const char WORDS[30] = "abcdefghijklmnopqrstuvwxyz.?! ";

int main(void) {
	char WORDSET[6][5];
	int w = 0;
	
	for(int i = 0; i < 6; i++) {
		for(int j = 0; j < 5; j++) {
			WORDSET[i][j] = WORDS[w];
			w++;
		}
	}
	
	while(1) {
		string str;
		
		cin >> str;
		if( cin.eof() ) { break; }
			else if( (int)str.size() % 2 != 0 ) { cout << "NA" << endl; continue; }
		string::iterator it = str.begin();
		while( it != str.end() ) {
			int a, b;
			
			a = *it - '0' - 1;
			it++;
			b = *it - '0' - 1;
			it++;
			
			cout << WORDSET[a][b];
		}
		cout << endl;
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,vector<T>(w)))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,vector<T>(w,i)))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

signed main()
{
	string inpt;
	while (cin >> inpt) {
		if (inpt.size() % 2 == 1) {
			cout << "NA" << endl;
		} else {
			string res;
			for (ll i = 0; i < inpt.length(); i += 2) {
				if (inpt[i] < '1' || inpt[i] > '6' || inpt[i + 1] < '1' || inpt[i + 1] > '5') {
					res = "NA";
					break;
				} else {
					int a = (int)(inpt[i] - '0');
					int b = (int)(inpt[i + 1] - '0');
					int idx = (a - 1) * 5 + (b - 1);
					res += idx < 26 ? 'a' + idx : ".?! "[idx - 26];
				}
			}
			cout << res << endl;
		}
	}
}