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 <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 < 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<bits/stdc++.h>
using namespace std;

int main(){
  char zu[8][9];
  string bun;
  char x='a';
  int nagasa;
  int smp1,smp2;
  for(int i=0;i<6;i++){
    for(int j=0;j<5;j++){
      zu[i][j] = x;
      x++;
    }
  }
  zu[5][1]='.';
  zu[5][2]='?';
  zu[5][3]='!';
  zu[5][4]=' ';
  cin >> bun;
  nagasa = bun.size();
  int flag=0;
  for(int i=0;i<nagasa;i=i+2){
    smp1 = bun[i]-'0'-1;
    smp2 = bun[i+1]-'0'-1;
    if(smp1 > 5 || smp2 > 4){
      flag = 1;
    }
  }
  int a = nagasa%2;
  if(a == 0 && flag == 0){
    for(int i=0;i<nagasa;i=i+2){
      smp1 = bun[i]-'0'-1;
      smp2 = bun[i+1]-'0'-1;
      cout << zu[smp1][smp2];
    }
    cout << endl;
  }
  else{
    cout << "NA" << endl;
  }
}

C++: #include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <strstream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

int main(){
	string s;
	while(cin>>s)
	{
		if(s.size()%2!=0){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0; i<s.size() ;i++)
		{
			int k;
			k =  ((int)s[i]-48)*10;
			k += (int)s[i+=1]-48;
			if(k==65)cout<<" ";
			else if(k==64)cout<<"!";
			else if(k==63)cout<<"?";
			else if(k==62)cout<<".";
			else{
				if(k<=15){
					char c=k+86;
					cout<<c;
				}
				else if(k<=25){
					char c=k+81;
					cout<<c;
				}
				else if(k<=35){
					char c=k+76;
					cout<<c;
				}
				else if(k<=45){
					char c=k+71;
					cout<<c;
				}
				else if(k<=55){
					char c=k+66;
					cout<<c;
				}
				else cout<<"z";
			}
		}
		puts("");
	}

	return 0;
}

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

using namespace std;

int main(void){
  string str;

  while(cin >> str){
	int n=str.size();
	int tmpi;
	char tmpc;

	if(n%2==1){
	  cout << "NA" << endl;
	  continue;
	}
	for(int i=0;i<n/2;i++){
	  tmpi = 0;
	  tmpc = str[i*2];
	  tmpi += (tmpc - '0') * 10;
	  tmpc = str[i*2+1];
	  tmpi += tmpc - '0';
	  switch(tmpi){
	  case 11:
		cout << "a";
		break;
	  case 12:
		cout << "b";
		break;
	  case 13:
		cout << "c";
		break;
	  case 14:
		cout << "d";
		break;
	  case 15:
		cout << "e";
		break;
	  case 21:
		cout << "f";
		break;
	  case 22:
		cout << "g";
		break;
	  case 23:
		cout << "h";
		break;
	  case 24:
		cout << "i";
		break;
	  case 25:
		cout << "j";
		break;
	  case 31:
		cout << "k";
		break;
	  case 32:
		cout << "l";
		break;
	  case 33:
		cout << "m";
		break;
	  case 34:
		cout << "n";
		break;
	  case 35:
		cout << "o";
		break;
	  case 41:
		cout << "p";
		break;
	  case 42:
		cout << "q";
		break;
	  case 43:
		cout << "r";
		break;
	  case 44:
		cout << "s";
		break;
	  case 45:
		cout << "t";
		break;
	  case 51:
		cout << "u";
		break;
	  case 52:
		cout << "v";
		break;
	  case 53:
		cout << "w";
		break;
	  case 54:
		cout << "x";
		break;
	  case 55:
		cout << "y";
		break;
	  case 61:
		cout << "z";
		break;
	  case 62:
		cout << ".";
		break;
	  case 63:
		cout << "?";
		break;
	  case 64:
		cout << "!";
		break;
	  case 65:
		cout << " ";
		break;
	  }
	}
	cout << endl;
  }
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	char* table = "abcdefghijklmnopqrstuvwxyz.?! ";
	char buf[512];
	while (cin.getline(buf, sizeof(buf)))
	{
		if (strlen(buf) & 1)
		{
			puts("NA");
			continue;
		}

		char decode[256];
		memset(decode, 0, sizeof(decode));
		bool ok = true;
		for (int i = 0; buf[i] != '\0'; i += 2)
		{
			int c = buf[i] - '0' - 1;
			int r = buf[i+1] - '0' - 1;
			if (c < 0 || r < 0 || c > 5 || r > 4)
			{
				ok = false;
				break;
			}

			decode[i/2] = table[c*5 + r];
		}
		if (ok)
			puts(decode);
		else
			puts("NA");
	}

	return 0;
}

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

using namespace std;

char META_CHARACTER[] = "z.?! ";

int main(void){
	for(string in, out; cin >> in; cout << out << endl){
		out.clear();
		if(in.length() % 2){ out = "NA"; continue; }

		for(int i = 0; i < in.length(); i += 2){
			int col = in.at(i) - '1';
			int row = in.at(i + 1) - '1';

			if(col == 5){ out.push_back(META_CHARACTER[row]); }
			else{ out.push_back('a' + 5 * col + row); }
		}
	}
		
		
	return 0;
}

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

int main(){
    char field[6][11];
    char a='a';
    for(int i=1; i < 7; i++){
        for(int j=1; j < 6; j++){
            field[j][i] = a;
            a++;
        }
    }
    field[2][6] = '.'; field[3][6] = '?'; field[4][6] = '!'; field[5][6] = ' ';

    string input;
    while(cin >> input){
        string ans;
        bool isCorrect = true;
        if(input.size()%2 == 1) {
            isCorrect = false;
        }
        else {
            for(int i=0; i < input.size(); i+=2){
                int n = atoi(input.substr(i, 1).c_str());
                int m = atoi(input.substr(i+1, 1).c_str());
                if(!(1 <= m && m <= 5 && 1 <= n && n <= 6)) isCorrect = false;
                ans += field[m][n];
            }
        }
        if(isCorrect) cout << ans << endl;
        else cout << "NA" << endl;
    }
}