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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
    string table[6] = {	"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "	};
	
	for(string line; cin >> line;)
	{
		if(line.size() % 2)
		{
			cout << "NA" << endl;
			continue;
		}
		
		string ans;
		rep(i, line.size() / 2) if('1' <= line[i * 2] && line[i * 2] <= '6' && '1' <= line[i * 2 + 1] && line[i * 2 + 1] <= '5')
			ans += table[line[i * 2] - '1'][line[i * 2 + 1] - '1'];
		
		if(ans.size() * 2 == line.size())
			cout << ans << endl;
		else
			cout << "NA" << endl;
	}
}

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

int main(){
    char map[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 s;
    while (cin >> s){
	bool err = false;
	for (int i = 0; i < s.size(); i++)
	    if (i % 2 && (s[i] > '5' || s[i] < '1')) err = true;
	    else if (i % 2 == 0 && (s[i] > '6' || s[i] < '1')) err = true;

	if (s.size() % 2 || err) cout << "NA" << endl;

	else {
	    for (int i = 0; i < s.size(); i+=2)
		 cout << map[s[i]-'0'-1][s[i+1]-'0'-1];
	    cout << endl;
	}
    }
}

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

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	string alpha = "abcdefghijklmnopqrstuvwxyz.?! ";
	char table[5][6];

	int t = 0;
	rep(i,6)
	{
		rep(j,5)
		{
			table[j][i] = alpha[t];
			t++;
		}
	}
	
	string s;
	while(cin >> s)
	{
		if(s.size()%2 != 0)
		{
			cout << "NA" << endl;
		}
		else
		{
			t = 0;
			bool flag = true;
			while(flag)
			{
				if(t >= s.size())
				{
					break;
				}
			
				int a = s[t] - '1';
				int b = s[t+1] - '1';
				bool flag = true;

				if(0 <= a && a < 6 && 0 <= b && b < 5)
				{
					cout << table[b][a];
					t += 2;
				}
				else
				{
					flag = false;
				}
			}
			cout << endl;
		}
	}
	return 0;
}

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

int main() {
  int i, p, q;
  bool b;
  char buf[201];
  char code[5][6] = {
    {'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', ' '},
  };

  while (cin.getline(buf, sizeof(buf))) {
    i = 0;
    b = true;
    while (buf[i]!='\0') {
      if (i&1) {
        if (buf[i]<'1'||buf[i]>'5') {
          b = false;
          break;
        }
      } else {
        if (buf[i]<'1'||buf[i]>'6') {
          b = false;
          break;
        }
      }
      ++i;
    }
    if (i&1) b = false;

    if (b) {
      i = 0;
      while (buf[i]!='\0') {
        p = buf[i++]-'1';
        q = buf[i++]-'1';
        cout << code[q][p];
      }
      cout << endl;
    } else {
      cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int main()
{
	char string[6][6],input[201];
	int i;
	for (i=0; i<26; i++) string[i/5][i%5]='a'+i;
	string[5][i++%5]='.',string[5][i++%5]='?';
	string[5][i++%5]='!',string[5][i++%5]=' ';
	while (scanf(" %s",input)!=EOF) {
		if (strlen(input)%2!=0) {
			cout<<"NA"<<endl;
			continue;
		}
		for (int i=0; i<strlen(input); i+=2) {
			cout<<string[input[i]-1-'0'][input[i+1]-1-'0'];
		}
		cout<<endl;
	}
}

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]) || S[i]=='0' || S[i+1]=='0'){
				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 <cstdio>
#include <cstring>
#define buf 10000
using namespace std;

int main(void){
  int i,n,m,len;
  char str[buf];

  for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
    len=strlen(str)-1;
    for(i=0;i<len-1;i+=2){
      if(len%2!=0){
        printf("NA");
        break;}
      n=(str[i]-'0')%48-1;
      m=(str[i+1]-'0')%48-1;
      if(n==5 && m==1)
        printf(".");
      else if(n==5 && m==2)
        printf("?");      
      else if(n==5 && m==3)
        printf("!");
      else if(n==5 && m==4)
        printf(" ");
      else
        printf("%c",'a'+n*5+m);
    }
    printf("\n");
  }
  return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include <sstream>
#include <cstdlib>
using namespace std;

int main(){

  char s[402],G[5][7]={'a','f','k','p','u','z','\0','b','g','l','q','v','.','\0','c','h','m','r','w','?','\0','d','i','n','s','x','!','\0','e','j','o','t','y','&','\0'};
  int i,j,temp,a,b,c;

  


  while(scanf("%s", s)!= EOF){
     temp = strlen(s);
     c=0;
     if(temp==0) continue;
     if(temp %2 == 0) {
       for(i=0;;i++){
	 if(s[i]=='\0') break;
	 if(s[i]-'0'<1 || s[i]-'0'>6) c=1;
       }
       if(c==1){
	 printf("NA\n");
	 continue;
       }
       for(i=0; i<temp; i+=2){
	 //a = atoi(s[i+1]);
	 //b = atoi(s[i]);
	 a=s[i+1]-'0';
	 b=s[i]-'0';
	 if(G[a-1][b-1] == '&') printf(" ");
	 else printf("%c",G[a-1][b-1]);
       }
     }else printf("NA");
     printf("\n");
  }
  return 0;
}

C++: #include <iostream>

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 temp[2];

int main() {

    string mes;

    while (cin>>mes) {

        if (mes.length()%2!=0) cout << "NA" << endl;

        else {

            string temp="", res="";

            for (int i=0; i<mes.length(); i++) {

                if (i%2!=0) {

                    temp[1] = mes[i] - '0';

                    if (temp[0]<1||temp[1]<1||temp[0]>6||temp[1]>6) {
                        res = "NA";
                        break;
                    } else {
                        res += table[temp[0]-1][temp[1]-1];
                    }

                } else temp[0] = mes[i] - '0';

            }

            cout << res << endl;

        }

    }

}