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

  


  while(scanf("%s", s)!= EOF){
     temp = strlen(s);
     if(temp %2 == 0) {
       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>
#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;
        s += "z";
        REP(l/2)
        {
            if(s[i * 2] >= '7') na = true;
            if(s[i * 2 + 1] >= '6') na = true;
        }
        //cout << s << endl;

        if(na){ cout << "NA" << endl; continue;}
        
        int v, h;
        REP(l/2){
            v = (int)(s[i*2] - OFS);
            h = (int)(s[i*2 +1] - OFS);
            cout << res[v][h] ;
            //cout << res[(char)(s[i*2] - OFS)][(char)(s[i*2+1] - OFS)];
        
        }
        cout << endl;

    }
    return 0;
}

C++: #include <iostream>
using namespace std;
const 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){
      if(!(0 <= str2[i+1]-'0'-1 && str2[i+1]-'0'-1 < 5 &&
	 0 <= str2[i]-'0'-1 && str2[i]-'0'-1 < 6)){
	cout << "NA" << endl;
	goto N;
      }
      ans += str[(str2[i+1] - '0')-1][(str2[i] - '0')-1]; 
    }
    cout << ans << endl;
  N:;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)

int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  string s;
  char c[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>>s){
    string out;
    if (s.size() % 2){
      cout << "NA" << endl;
    }else{
      bool flag = false;
      for(int i = 1 ; i < s.size() ; i += 2){
	int y = s[i - 1] - '1';
	int x = s[i] - '1';
	if(y < 0 || x < 0 || y >= 6 || x >= 5){
	  flag = true;
	  break;
	}
	out += c[x][y]; 	
      }
      if(flag)
	cout << "NA" << endl;
      else 
	cout << out << endl;
    }
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s,t[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",".","?","!"," "}};
  bool f;
  while(cin >> s){
    f=true;
    if(s.size()%2){
      cout << "NA\n";
      continue;
    }
    for(int i=0;i<s.size();i++){
      if(i%2==0){
        if((int)s[i]>54){
          cout << "NA\n";
          f=false;
        }
      }else{
        if((int)s[i]>53){
          cout << "NA\n";
          f=false;
        }
      }
      if((int)s[i]<49 and f){
        cout << "NA\n";
        f=false;
      }
      if(!f)break;
    }
    if(!f)continue;
    for(int i=0;i<s.size();i+=2){
      cout << t[(int)s[i]-49][(int)s[i+1]-49];
    }
    cout << endl;
  }
  return 0;
}

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

int main(){
	string ss,ans;
	while(cin>>ss){
		int size=ss.size();
		if(size%2==1){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<size;i+=2){
			int num=((int)(ss[i]-'0')-1)*5+((int)(ss[i+1]-'0'))-1;
			if(num<26){
				ans+=(char)(num+'a');
			}else if(num==26){
				ans+='.';
			}else if(num==27){
				ans+='?';
			}else if(num==28){
				ans+='!';
			}else if(num==29){
				ans+=" ";
			}else{
				ans="NA";
				break;
			}
		}
		cout<<ans<<endl;
		ans="";
	}
	return 0;
}

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

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

char convert(int x) {
  int x1 = x/10;
  int x2 = x-x1*10;
  if(x1 == 1) {
    if(x2 == 1) return 'a';
    if(x2 == 2) return 'b';
    if(x2 == 3) return 'c';
    if(x2 == 4) return 'd';
    if(x2 == 5) return 'e';
  }
  if(x1 == 2) {
    if(x2 == 1) return 'f';
    if(x2 == 2) return 'g';
    if(x2 == 3) return 'h';
    if(x2 == 4) return 'i';
    if(x2 == 5) return 'j';
  }
  if(x1 == 3) {
    if(x2 == 1) return 'k';
    if(x2 == 2) return 'l';
    if(x2 == 3) return 'm';
    if(x2 == 4) return 'n';
    if(x2 == 5) return 'o';
  }
  if(x1 == 4) {
    if(x2 == 1) return 'p';
    if(x2 == 2) return 'q';
    if(x2 == 3) return 'r';
    if(x2 == 4) return 's';
    if(x2 == 5) return 't';
  }
  if(x1 == 5) {
    if(x2 == 1) return 'u';
    if(x2 == 2) return 'v';
    if(x2 == 3) return 'w';
    if(x2 == 4) return 'x';
    if(x2 == 5) return 'y';
  }
  if(x1 == 6) {
    if(x2 == 1) return 'z';
    if(x2 == 2) return '.';
    if(x2 == 3) return '?';
    if(x2 == 4) return '!';
    if(x2 == 5) return ' ';
  }
  return ' ';
}

int main() {
  string str;
  while(cin >> str) {
    if(str.size() % 2 == 1) {
      cout << "NA" << endl;
    }
    else {
      for(unsigned int i=0;i<str.size();i+=2) {
	int x = atoi(str.substr(i,2).c_str());
	cout << convert(x);
      }
      cout << endl;
    }
  }
}