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

char maze[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',' '}
  };

int main(void){
  string in;
  while(cin>>in){
    //cout<<in.size()<<endl;
    if(in.size()%2==0){
      rep(i,in.size()){
	cout<<maze[in[i+1]-'0'-1][in[i]-'0'-1];
	i ++;
      }
      cout<<endl;
    }else
      cout<<"NA"<<endl;
  }
}

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] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};

const char OFS = '1';
int main()
{
    string s;
    while(getline(cin, s))
    {
        bool na = false;
        int l = s.size();

        if(l%2) na = true;
        s = s + "z";
        REP(l/2)
        {
            if(s[i * 2] >= '7' || s[i*2] == '0') na = true;
            if(s[i * 2 + 1] >= '6' || s[i*2] == '0') na = true;
        }
        if(na){ cout << "NA" << endl; continue;}
        
        REP(l/2) cout << res[(char)(s[i*2] - OFS)][(char)(s[i*2+1] - OFS)];
        cout << endl;

    }
    return 0;
}

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

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const char *data = "abcdefghijklmnopqrstuvwxyz.?! ";
int main(){
  string str;
  while(getline(cin,str)){
    string ans;
    int pos = 0;
    //printf("pos = %d, str.size()=%d\n",pos,str.size());
    while(true){
      if(pos != str.size()){
        if(pos + 1 == str.size())
          goto na;

        int a = str[pos++] - '0';
        int b = str[pos++] - '0';
        //printf("a = %d, b = %d\n",a,b);
        if(a < 1 || a > 6) goto na;
        if(b < 1 || b > 5) goto na;
        a--; b--;
        ans += data[a*5 + b];
      }else{
        cout << ans << endl;
        break;
      }
    }
    continue;
  na:
    cout << "NA" << endl;
  }
  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 = (int)(in.at(i) - '1');
			int row = (int)(in.at(i + 1) - '1');

			if(col > 5 || row > 4){ out = "NA"; break; }

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    char u[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 flag=true;
        if(s.length()%2){cout<<"NA"<<endl; flag=false;}
    if(flag){
    vector<pii>v(1000);
    rep(i,s.length()/2){
        v[i]=pii(s[2*i]-48,s[2*i+1]-48);
        if(v[i].first>6||v[i].second>5){goto E;}
    }
    rep(i,s.length()/2)
    cout<<u[v[i].first-1][v[i].second-1];
    cout<<endl;
    }
    E:;
    }
}

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

char table[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',' '}
} ;

main(){
	string s ;
	while( cin >> s ){
		if( cin.eof() ) break ;
		if( s.size() % 2 ){
			cout << "NA" << endl ;
			continue ;
		}
		bool t = false ;
		for( int i=0 ; i<s.size() ; i+=2 ){
			if( s[i]-'0' >= 1 && s[i]-'0' <= 6 &&
				s[i+1]-'0' >= 1 && s[i+1]-'0' <= 5 ){}
			else t = true ;
		}
		
		if( t ){
			cout << "NA" << endl ;
			continue ;
		}
		
		for( int i=0 ; i<s.size() ; i+=2 ) cout << table[s[i+1]-'0'-1][s[i]-'0'-1] ;
		cout << endl ;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  string nums,text,ch;
  ch = "abcdefghijklmnopqrstuvwxyz.?! ";
  while(cin>>nums){
    text = "";
    if(nums.size()%2){
      cout<<"NA"<<endl;
    }
    else{
      for(int i=0;i<nums.size()/2;i++){
    if('0'<nums[i*2]&&nums[i*2]<'7'&&'0'<nums[i*2+1]&&nums[i*2+1]<'6')
      text=text+ch[5*(nums[i*2]-49)+(nums[i*2+1]-49)];
    else{
      text="NA";
      break;
    }
      }
      cout<<text<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
string S, T; int a;
char c[101] = "00000000000abcde00000fghij00000klmno00000pqrst00000uvwxy00000z.?! 0000000000000000000000000000000000";
int main() {
	while (cin >> S) {
		T = "";
		if (S.size() % 2 == 1) {
			cout << "NA" << endl; goto E;
		}
		for (int i = 0; i < S.size() / 2; i++) {
			a = stoi(S.substr(i * 2, 2));
			if (c[a] == '0') { cout << "NA" << endl; goto E; }
			else { T += c[a]; }
		}
		cout << T << endl;
	E:;
	}
}