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 <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<vector<int> > code(10, vector<int>(10, '*'));
    for(int i=0; i<26; ++i)
        code[i/5+1][i%5+1] = 'a' + i;
    code[6][2] = '.';
    code[6][3] = '?';
    code[6][4] = '!';
    code[6][5] = ' ';

    for(;;){
        string s;
        if(!(cin >> s))
            return 0;

        int n = s.size();
        if(n % 2 == 1){
            cout << "NA" << endl;
            continue;
        }

        string ret(n/2, ' ');
        bool na = false;
        for(int i=0; i<n; i+=2){
            char c = code[s[i]-'0'][s[i+1]-'0'];
            if(c == '*'){
                na = true;
                break;
            }
            ret[i/2] = c;
        }

        if(na)
            cout << "NA" << endl;
        else
            cout << ret << endl;
    }
}

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


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

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

int main() {
	string in;
	while(cin >> in) {
		int table[256] = {0};
		bool NA_flag = false;
		string ans = "";
		
		if(in.size() % 2)
			NA_flag = true;

		if(!NA_flag) {
			for(int i = 0; i < in.size(); i += 2) {
				if(in[i] < '1' || '6' < in[i]) NA_flag = true;
				if(in[i + 1] < '1' || '5' < in[i + 1]) NA_flag = true;

				table[i / 2] = 5 * (in[i] - '1') + in[i + 1] - '1';
			}
		}

		if(!NA_flag) {
			for(int i = 0; i < in.size() / 2; i++) {
				if(table[i] < 26)
					ans += 'a' + table[i];
				else if(table[i] == 26)
					ans += '.';
				else if(table[i] == 27)
					ans += '?';
				else if(table[i] == 28)
					ans += '!';
				else if(table[i] == 29)
					ans += ' ';
			}
		}

		if(NA_flag)
			cout << "NA" << endl;
		else
			cout << ans << endl;
	}

	return 0;
}

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

map<string,int> m;

void change(){
    m["11"] = 'a'; m["12"] = 'b'; m["13"] = 'c'; m["14"] = 'd'; m["15"] = 'e';
    m["21"] = 'f'; m["22"] = 'g'; m["23"] = 'h'; m["24"] = 'i'; m["25"] = 'j';
    m["31"] = 'k'; m["32"] = 'l'; m["33"] = 'm'; m["34"] = 'n'; m["35"] = 'o';
    m["41"] = 'p'; m["42"] = 'q'; m["43"] = 'r'; m["44"] = 's'; m["45"] = 't';
    m["51"] = 'u'; m["52"] = 'v'; m["53"] = 'w'; m["54"] = 'x'; m["55"] = 'y';
    m["61"] = 'z'; m["62"] = '.'; m["63"] = '?'; m["64"] = '!'; m["65"] = ' ';
}

int main(){
    string str;
    
    change();
    
    while(cin >> str){
        if(str.size()%2==1) cout << "NA" << endl;
        else{
            string ans = "";
            for(int i = 0 ; i < str.size() ; i++){
                string k = str.substr(i,2);
                if(i%2==0){
                    ans += m[k];
                }
            }
            cout << ans << endl;
        }
    }
    
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	char c[4] = {'.','?','!',' '};
	string S;
	while(cin>>S){
		string ans;
		if(S.size()%2!=0){
			puts("NA"); goto NEXT;
		}
		for(int i=0;i<S.size();i+=2){
			if(!isdigit(S[i]) || !isdigit(S[i+1])){
				puts("NA"); goto NEXT;
			}
			int n = (S[i]-'0'-1)*5+(S[i+1]-'0'-1);
			if(n<26) ans += ('a'+n);
			else if(n<30) ans += c[n-26];
			else{
				puts("NA"); goto NEXT;
			}
		}
		cout<<ans<<endl;
		NEXT:;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
char t[5][6];
int main()
{
    char c='a';
    for(int j=0;j<5;++j){
        for(int i=0;i<5;++i){
            t[i][j]=c;
            c++;
        }
    }
    t[0][5]='z';
    t[1][5]='.';
    t[2][5]='?';
    t[3][5]='!';
    t[4][5]=' ';
    string ns;
    while(cin>>ns)
    {
        if(ns.length()%2){
            cout<<"NA"<<endl;
        }else{
            bool flag=false;
            for(int i=0;i<ns.length()-1;i+=2){
                if(ns[i]>=6|ns[i]<1|ns[i+1]>=5|ns[i]<1){
                    flag=true;
                }
            }
            if(flag){
                cout<<"NA"<<endl;
            }else{
                for(int i=0;i<ns.length()-1;i+=2){
                    cout<<t[ns[i+1]-'1'][ns[i]-'1'];
                }
                cout<<endl;
            }
        }
    }
    return 0;
}

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

using namespace std;

string str[6];

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

C++: // 2011/03/23 Tazoe

#include <iostream>
#include <string>
using namespace std;

int main()
{
	string trn[7][6] = {{"/", "/", "/", "/", "/", "/"},
	                    {"/", "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", ".", "?", "!", " "}};

	while(!cin.eof()){
		string str;
		cin >> str;
		if(str.empty())
			continue;

		string str2 = "";
		int i = 0;
		while(i<str.size()){
			if(str[i]<'1'||str[i]>'6'){
				str2 = "NA";
				break;
			}

			int j = str[i]-'0';

			i++;
			if(i>=str.size()){
				str2 = "NA";
				break;
			}

			if(str[i]<'1'||str[i]>'5'){
				str2 = "NA";
				break;
			}

			int k = str[i]-'0';
			str2 += trn[j][k];

			i++;
		}

		cout << str2 << endl;
	}

	return 0;
}

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

const char OFS = '1';
int main()
{
    res[0] = "abcde";
    res[1] = "fghij";
    res[2] = "klmno";
    res[3] = "pqrst";
    res[4] = "uvwxy";
    res[5] = "z.?! ";

    string s;
    while(getline(cin, s))
    {
        bool na = false;
        int l = s.size();
        if(l%2) na = true;
        REP(l/2)
        {
            if(s[i * 2] >= '7') na = true;
            if(s[i * 2 + 1] >= '6') 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;
}