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<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
char in[200]={'\0'};
char out[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(){
  while(cin>>in){
    int co=0;
    rep(i,200)if(in[i]!='\0')co++;
	if(co%2){rep(i,co)in[i]='\0';cout<<"NA"<<endl;continue;}
	bool a=true;
	rep(i,co){
	  if(!i%2&&(in[i]<='0'||in[i]>'6'))a=false;
	  if(i%2&&(in[i]<='0'||in[i]>'5'))a=false;
	}
	if(!a){rep(i,co)in[i]='\0';cout<<"NA"<<endl;continue;}
	rep(i,co){
	  int a,b;
	  a=in[i]-'1';
	  i++;
	  b=in[i]-'1';
	  cout<<out[b][a];
	}
    cout<<endl;
	rep(i,co)in[i]='\0';
  }
}

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

using namespace std;

int main(){
    long i, k, na;
    string s, t;
    while(cin>>s){
        t="";
        na=0;
        for(i=0; i<s.size(); i+=2){

            if(49>s[i] || s[i]>54 || 49>s[i+1] || s[i+1]>53){
                na=1;
                break;
            }

            k= (s[i]-48)*5 + 91 + (s[i+1]-48);
            if(s.substr(i,2)=="62"){
                k = 46;
            } else if(s.substr(i,2)=="63"){
                k = 63;
            } else if(s.substr(i,2)=="64"){
                k = 33;
            } else if(s.substr(i,2)=="65"){
                k = 32;
            }
            t+=k;
        }

        if(na) cout << "NA";
        else cout << t;
        cout << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  char table[5][6];
  char c='a';
  for(int j=0;j<5;j++){
    for(int i=0;i<5;i++){
      table[i][j]=c;
      c++;
    }
  }
  table[0][5]='z';table[1][5]='.';table[2][5]='?';table[3][5]='!';table[4][5]=' ';
 
  string s;
  while(cin>>s){
    if(s.size()%2==0){
      //cout<<s.size()<<endl;
      for(int i=0;i<s.size();i+=2){
	cout<<table[s[i+1]-'0'-1][s[i]-'0'-1];
      }
      cout<<endl;
    }else{
      cout<<"NA"<<endl;
    }
  }
}

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

int main()
{
  string s;

  for(;cin>>s;)
    {
      bool flag=true;
      string ans="";
      if(s.size()%2!=0)
	  flag=false;

      for(int i=0;i<s.size()&&flag;i+=2)
	{
	  if(s[i]>'6' ||s[i+1]>'5')
	    flag=false;

	  if(s[i]=='6')
	    {
	      if(s[i+1]=='1')
		ans+="z";
	      if(s[i+1]=='2')
		ans+=".";
	      if(s[i+1]=='3')
		ans+="?";
	      if(s[i+1]=='4')
		ans+="!";
	      if(s[i+1]=='5')
		ans+=" ";
	    }
	  else
	    {
	      int a=s[i]-'0';
	      int b=s[i+1]-'0';
	      char tmp='a'+(5*(a-1))+(b-1);
	      ans+=tmp;
	    }
	}
      
      if(flag)
	cout<<ans<<endl;
      else
	cout<<"NA"<<endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(void){
	const char *table[] ={
		"afkpuz",
		"bglqv.",
		"chmrw\?",
		"dinsx!",
		"ejoty "
	};

	while( true ){
		bool bNA = false;
		string s;

		cin >> s;

		if( cin.eof() )
			break;

		if( s.length() % 2 == 1 ){
			bNA = true;
			goto NA;
		}
		for(unsigned int l = 0; l < s.length(); l += 2){
			int i = s[l+1]-'0'-1;
			int j = s[l]-'0'-1;
			if( !(0 <= i && i <= 5) || !(0 <= j && j <= 5) ){
				bNA = true;
				goto NA;
			}
		}
NA:;
		if( bNA ){
			cout << "NA\n";
			continue;
		}

		for(unsigned int l = 0; l < s.length(); l += 2){
			int i = s[l+1]-'0'-1;
			int j = s[l]-'0'-1;
			cout << table[i][j];
		}
		cout << '\n';
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)
typedef long long ll;

using namespace std;


int main(void){

string s[]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
string ind,res;
	while(cin >> ind){
		if(cin.eof()) break;
		res="";
		for(int i=0; i<ind.size(); i+=2){
			char s1=ind[i], s2=ind[i+1];
			if(s1<'1' | s1>'6' || s2<'1' || s2>'5' ){
				res = "NA";  break;
			}
			res += s[s1 - '0'- 1][s2 - '0'- 1];
		}
		cout << res << endl;
	}
	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;
    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>=7||v[i].second>=6){goto E;}
    }
    rep(i,s.length()/2)
    cout<<u[v[i].first-1][v[i].second-1];
    cout<<endl;
    }
    E:;
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main(){
    char a[7][7] = {"","*abcde","*fghij","*klmno","*pqrst","*uvwxy","*z.?! "};

    while(~scanf("%s",s)){
        char s[200];
        if(strlen(s)%2==1)printf("NA\n");
        else{
            for(int i=0;i<strlen(s);i+=2){
                printf("%c",a[s[i]-48][s[i+1]-48]);

            }
            printf("\n");
        }
    }
    return 0;
}

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

int main(){

  char s[201],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;
}