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

int main() {
    string str;
    vector<string> vs = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};
    while (cin >> str) {
        if (str.size() % 2) {
            cout << "NA" << endl;
            continue;
        }
        string ans;
        for (int i = 0; i < str.size(); i+=2) {
            int a = str[i] - '0' - 1;
            int b = str[i+1] - '0' - 1;

            if (0 <= a && a < 6 && 0 <= b && b < 5) {
                ans += vs[a][b];
            } else {
                ans = "NA";
                break;
            }
         }

        cout << ans << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main()
{
	string s,r;
	int i;
	const char *a[7] = 
	{
		"afkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty ",
	};
	while(cin >> s)
	{
		r="";
		for(i=0;i+1<s.size();i+=2)
		{
			if(s[i]>'6' || s[i+1]>'5' || s[i]<'1' || s[i+1]<'1') break; 
			r+=a[s[i+1]-'1'][s[i]-'1'];
		}
		if(i != s.size())
			cout << "NA"<<endl;
		else
			cout << r << endl;
	}
	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;
                }
            }
            if(!flg){
                for(int i=0;i<strlen(s);i+=2){
                    printf("%c",a[s[i]-48][s[i+1]-48]);
                }
            }

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

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

using namespace std;

int main ( void )
{
	string str;
	
	string hyo[] = { "abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! " };
	
	while (cin >> str)
	{
		if (str.size() % 2)
		{
			cout << "NA" << endl;
			continue;
		}
		
		string out = "";
		
		for (int i = 0, len = str.size(); i < len; i+=2)
		{
			int x, y;
			
			y = str[i] - '1';
			x = str[i+1] - '1';
			
			out += hyo[y][x];
		}
		
		cout << out << endl;
	}
	
	return 0;
}

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

int index[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 main() {
  string s;
  while(cin >> s) {
    if(s.size()%2) cout << "NA" << endl;
    else {
      for(int i = 0; i < s.size(); i += 2) {
        int column = s[i]-'1', row = s[i+1]-'1';
        if(column > 6 || row > 5) {
          cout << "NA" << endl;
          break;
        }
        printf("%c", index[column][row]);
      }
      cout << endl;
    }
  }
}

C++: #include<iostream>

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[((int)in[i+1]-(int)'0')][((int)in[i]-(int)'0'-1)];
    }
    cout << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstring>
#include<string>
using namespace std;
int n(char c){
  return c - '0';
}
int main(void){
  char c[8][8];
  string s, ans;
  int l, x, y;
  strcpy(c[1], "abcde"); strcpy(c[2], "fghij"); strcpy(c[3], "klmno");
  strcpy(c[4], "pqrst"); strcpy(c[5], "uvwxy"); strcpy(c[6], "z.?! ");
 lbl:;
  while(cin >> s){
    l = s.size();
    if(l % 2){
      cout << "NA" << endl;
      continue;
    }
    ans = "";
    for(int i = 0;i < l; i += 2){
      x = n(s[i]); y = n(s[i + 1]);
      if(1 <= x && x <= 6 && 1 <= y && y <= 5)
	ans += c[x][--y];
      else{
	cout << "NA" << endl;
	goto lbl;
      }
    }
    cout << ans << endl;
  }
}

C++: #include<iostream>
#include<string>
#define rep(i,x) for(int i=0;i<x;i++)
using namespace std;
string s;
char tab[10][10]={"abcde","fghij","klmno","pqrst","uvwxy","x.?! "};
void solve(){
	int n=0,k=0;
	char ans[1000];
	if(s.size()%2!=0){
		cout<<"NA"<<endl;
		return ;
	}
	else{
		while(n<s.size()){
			if(s[n]>='1'&&s[n]<'7'&&s[n+1]>='1'&&s[n+1]<'6')
			ans[k++]=tab[s[n]-1-'0'][s[n+1]-1-'0'];
			else{

				cout<<"NA"<<endl;
				return ;
			}
			n+=2;
		}
		rep(i,k)
		cout<<ans[i];
		cout<<endl;
	}
}
int main(){
	while(cin>>s){
		solve();
	}
	return 0;
}

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

int main(){
	string map[6];
	map[0] = "abcde";
	map[1] = "fghij";
	map[2] = "klmno";
	map[3] = "pqrst";
	map[4] = "uvwxy";
	map[5] = "z.?! ";
	string str;
	while(cin >> str){
		int num[1000]={0};
		int len = str.size();
		bool flag = false;
		for(int i=0;i<len;i+=2){
			if(str[i] <= '0' || str[i] > '6'){
				flag = true;
				break;
			}
			else if(str[i+1] <= '0' || str[i+1] > '5'){
				flag = true;
				break;
			}
		}
		if(len%2 == 1 || flag){
			cout << "NA" << endl;
			continue;
		}
		for(int i=0;i<len;i+=2){
			for(int j=i;j<i+2;j++){
				string tmp = "";
				tmp += str[j];
				istringstream ss(tmp);
				ss >> num[j];
				//cout << num[j] << endl;
			}
		}
		for(int i=0;i<len;i+=2){
			cout << map[num[i]-1][num[i+1]-1];
		}
		cout << endl;
	}
}

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

// infty
#define ULLINF (ULLONG_MAX)
#define LLINF  (LLONG_MAX)
#define IINF   (INT_MAX)
#define INF    (1<<29)

// math
#define Sq(x) ((x)*(x))

// container utility
#define ALL(x) (x).begin(), (x).end()
#define MP make_pair
#define PB push_back
#define EACH(it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();it++)

// rep
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

// typedef
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef vector<VI> VVI;

typedef long long ll;

// pair util
#define FST first
#define SND second

// range validator
#define CK(n,a,b) (a<=n && n<b)

// conversion
template<class T> inline string toStr(T a) { ostringstream oss_; oss_ << a; return oss_.str(); }
inline int toInt(string s) { return atoi(s.c_str()); }

// prime
bool isPrime(int a) { for(int i=2; i*i <=a; i++) if(a%i == 0) return false; return true; }

int const dx[] = {-1,0,1,0,-1,1,1,-1};
int const dy[] = {0,-1,0,1,-1,-1,1,1};

//////////////////////////////////////////////////////////////


int main() {
  
  string s;
  while(cin >> s) {
    int const N = s.size();
    
    if(N%2) {
      cout << "NA" << endl;
      continue;
    }
    
    for(int i=0; i<N; i+=2) {
      int a = s[i]-'0'-1; if(!CK(a, 0, 6)) { cout << "NA" << endl; goto EXIT; }
      int b = s[i+1]-'0'-1; if(!CK(b, 0, 5)) { cout << "NA" << endl; goto EXIT; }
      
      char ch = (char)('a' + a*5+b);
      if(!CK(ch,'a','z'+1)) {
	if(b == 1 && a == 5) ch = '.';
	if(b == 2 && a == 5) ch = '?';
	if(b == 3 && a == 5) ch = '!';
	if(b == 4 && a == 5) ch = ' ';
      }
      cout << ch;
    }
    cout << endl;
    
  EXIT:;
  }
  
  return 0;
}