Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
		"strconv"
	)

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++: #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;
		}
	}
}

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

const string characters = "abcdefghijklmnopqrstuvwxyz.?! ";

string convert(const string &number) {
	if(number.size() & 1) return "NA";

	string res = "";
	for(unsigned i = 0; i < number.size(); i += 2) {
		if(!('1' <= number[i] && number[i] <= '6')) return "NA";
		if(!('1' <= number[i + 1] && number[i + 1] <= '5')) return "NA";


		const unsigned idx = (number[i] - '1') * 5 + (number[i + 1] - '1');

		if(idx >= characters.size()) return "NA";

		res += characters[idx];
	}

	return res;
}

int main() {
	string number;
	while(cin >> number) {
		cout << convert(number) << endl;
	}

	return EXIT_SUCCESS;
}

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;
		string ans;
		bool fl = true;
		
		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++;
			
			if(0 <= a && a < 6 && 0 <= b && b < 5) {
				ans += WORDSET[a][b];
			} else {
				fl = false;
				break;
			}
		}
		if(fl) {
			cout << ans << endl;
		} else {
			cout << "NA" << 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 <iostream>
#include <string.h>
using namespace std;

int main() {
	
	char table[31] = "abcdefghijklmnopqrstuvwxyz.?! ",s[201];
	int i,l;
	
	while(cin>>s){
		l=strlen(s);
		if(l%2)
			cout<<"NA";
		else
			for(i=0;i<l;i+=2)
				cout << table[(s[i]-'1')*5+s[i+1]-'1'];
		cout<<endl;
	}
	return 0;
}

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

int main(){
char moji[5][7] = {{'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',' '}};
    string s;
    while(cin >> s){
        for(int i=0;i<s.size();i+=2){
            if(s.size() % 2 != 0) {
                cout << "NA";
                break;
            }
            if((s[i]%'0'-1) > 6 || (s[i+1]%'0'-1) > 5){
                cout << "NA";
                break;
            }
            cout << moji[(s[i+1]%'0')-1][(s[i]%'0')-1];
        }
        cout << endl;
    }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )
#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = (c).begin(); it != (c).end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define PB( n ) push_back( ( n ) )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define fst first
#define snd second

int main()
{
	string line;

	while ( cin >> line )
	{
		if ( line.length() % 2 )
		{
			cout << "NA" << endl;
			continue;
		}
		
		string res;

		for ( unsigned int i = 0; i + 1 < line.length(); i += 2 )
		{
			int a, b;
			a = line[i] - '1';
			b = line[i+1] - '1';

			int code = a * 5 + b;

			if ( code < 0 )
			{
				res = "NA";
				break;
			}
			else if ( code < 26 )
			{
				res += 'a' + code;
			}
			else if ( code == 26 )
			{
				res += '.';
			}
			else if ( code == 27 )
			{
				res += '?';
			}
			else if ( code == 28 )
			{
				res += '!';
			}
			else if ( code == 29 )
			{
				res += ' ';
			}
			else
			{
				res = "NA";
				break;
			}
		}

		cout << res << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string s;
	char ch[4] = {'.', '?', '!', ' '};
	while(cin >> s) {
		if(s.length()%2!=0) {
			cout << "NA" << endl;
			continue;
		}
		rep(i,s.length()/2) {
			char x = s[2*i];
			if(x<'1' || '6'<x) {
				cout << "NA";
				break;
			}
			char y = s[2*i+1];
			if(y<'1' || '5'<y) {
				cout << "NA";
				break;
			}
			int ret = (x-'0'-1)*5+y-'0'; 
			if(ret<=26) cout << (char)('a'+ret-1);
			else cout << ch[ret-27];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
#include <string.h>
int main(){
	char table[7][6],moji,chara[5]={'z','.','?','!',' '},s[256];
	moji='a';
	for(int i=1;i<7;i++){
		for(int j=1;j<6;j++){
			if(i<6) table[i][j]=moji++;
			else table[i][j]=chara[j-1];
		}
	}
	while(~scanf("%s",s)){
		int length=strlen(s);
		if(length%2!=0) printf("NA");
		else{
			int i;
			for(i=1;i<length;i+=2) if(s[i-1]-48>6||s[i]-48>5||s[i-1]-48<1||s[i]-48<1) break;
			if(i>length) for(i=1;i<length;i+=2) printf("%c",table[s[i-1]-48][s[i]-48]);
			else printf("NA");
		}
		printf("\n");
	}
	return 0;
}