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++: #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] == '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 = ' ';
            }else{
                a = 'a' + (s[i + 1] - '1') + 5 * (s[i] - '1');
            }
            ans+= a;
            i+= 2;
        }
        cout << ans << endl;
    }
}

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<iostream>
#include<string>
using namespace std;
int main() {
	char a[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','.','?','!',' '} };
	string b;
	while (cin >> b) {
		string c = "";
		if (b.length() % 2 == 1) {
			cout << "NA" << endl;  goto stop;
		}
		int h, w;
		for (int i = 0; i < b.length() ; ) {
			h = (int)b[i++] - '0';
			w = (int)b[i++] - '0';
			h--; w--;
			c += a[h][w];
			h = 0; w = 0;
		}
		cout << c << endl;
	stop:;
	}
}

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

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

C++: #define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>


#ifdef _DEBUG
#define typeof(X) std::identity<decltype(X)>::type //C++0x (for vs2010)
#else
#define typeof(X) __typeof__(X) // for gcc
#endif

#define sz(a)  int((a).size())
#define FOREACH(it, c) for (typeof((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define FOR(i,count) for (int i = 0; i < (int)(count); i++)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
const int MODULO = 100000 ;
const int INF = 100000000; //1e8

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef complex<double> Cd;

using namespace std;

int main()
{
	char t[] = "abcdefghijklmnopqrstuvwxyz.?! ";
	char buf[256];
	while(~scanf("%s",buf)){
		int n = strlen(buf);
		if(n % 2 != 0){
			puts("NA"); continue;
		}
		n /= 2;
		char nw[256];
		FOR(i,n){
			int a = (buf[i*2] - '0') * 5 + buf[i*2+1] - '0' - 6;
			if(a >= 30){
				puts("NA"); continue;
			}
			nw[i] = t[a];
		}
		nw[n] = '\0';
		puts(nw);
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    char l[6][6]={{0}};
    for(int i=0;i<5;i++){
        for(int j=0;j<5;j++)
            l[i][j]='a'+i*5+j;
    }
    strcpy(l[5],"z.?! ");
 
    char str[256];
    while(scanf("%s",str)!=EOF){
        if(strlen(str)&1){
            puts("NA");
            continue;
        }
        bool flag=true;
        char ans[128]={0};
        for(int i=0;str[i];i+=2){
            int v1=str[i]-'0'-1,v2=str[i+1]-'0'-1;
            if(v1<0||v1>=6||v2<0||v2>=5){
                puts("NA");
                flag=false;
                break;
            }
            ans[i/2]=l[v1][v2];
        }
        if(flag)printf("%s\n",ans);
    }
    return 0;
}

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

int main(void){
	int i,len,size;
	char s[1024],rst[512],n[6][8]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
	bool flg;

	while(cin>>s){
		size = 0;
		flg = true;
		if((len = strlen(s)) % 2 != 0) flg = false;

		for(i=0;flg && i<len;i+=2){
			if('0'<s[i] && s[i]<'7' && '0'<s[i+1] && s[i+1]<'6')
				rst[size++] = n[s[i]-'1'][s[i+1]-'1'];
			else
				flg = false;
		}
		rst[size] = 0;

		if(flg) cout<<rst<<endl;
		else cout<<"NA\n";
	}

	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;
    }
    int status = 0;
    for(int i = 0; i < in.length(); i++){
      if(in[i] < '1' || in[i] > '9') status = 1;
    }
    if(status){
      cout << "NA" << endl;
      continue;
    }
    for(int i = 0; i < in.length()-1; i+=2){
      cout << str[in[i+1]-'0'][in[i]-'0'-1];
    }
    cout << endl;
  }
  return 0;
}

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

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

string str[] = {"abkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty "};

int main(){
  string str2;
  while( cin >> str2 ){ 
    string ans="";
    if(str2.size()%2 == 1){
      cout << "NA" << endl;
      continue;
    }
    for(int i = 0 ; i < (int)str2.size() ; i+=2){
      ans += str[str2[i+1] - '0'-1][str2[i] - '0'-1]; 
    }
    cout << ans << endl;
  }
  return 0;
}