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

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main(){
    char a[7][7] = {"","*abcde","*fghij","*klmno","*pqrst","*uvwxy","*z.?! "};
    char s[200];
    while(~scanf("%s",s)){
        bool flg = false;
        if(strlen(s)%2==1)flg = true;
        else{
            for(int i=0;i<strlen(s);i+=2){
                if(s[i]<49||s[i]>54||s[i+1]<49||s[i+1]>53){
                    flg = true;
                    break;
                }
                printf("%c",a[s[i]-48][s[i+1]-48]);
            }

        }
        if(flg)printf("NA");
        printf("\n");
    }
    return 0;
}

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;
	p:;
	}
}

C++: #include <iostream>
using namespace std;
string str[] = {"abkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty "};
int main(){
  string str2;
  cin >> str2; 
     string ans="";
    if(str2.size()%2 == 1){
      cout << "NA" << endl;
    }
    for(int i = 0 ; i < str2.size() ; i+=2){
      ans += str[str2[i+1] - '0'-1][str2[i] - '0'-1]; 
    }
    cout << ans << endl;
  return 0;
}