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 <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

string a[]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};

int main(){
	string s;
	while(cin>>s){
		stringstream ss;
		if(s.size()%2){
			cout<<"NA\n";
			continue;
		}
		bool f=false;
		rep(i,s.size()){
			int x=s[i]-'0'-1,y=s[i+1]-'0'-1;
			if(!(-1<x&&x<6)||!(-1<y&&y<5)){
				// cout<<x<<" "<<y<<endl;
				f=true;
				break;
			}
			ss<<a[x][y];
			i++;
		}
		if(f){
			cout<<"NA\n";
			continue;
		}
		string tmp;
		getline(ss,tmp);
		cout<<tmp<<endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <vector>
#include <sstream>
#include <functional>
using namespace std;
char table[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){
		string ans="\0";
		if(!(s.length()%2)){
			for(int i=0;i<(int)s.length();i+=2){
				if('1'<=s[i]&&s[i]<='6'&&'1'<=s[i+1]&&s[i+1]<='5'){
					ans+=table[s[i]-'0'-1][s[i+1]-'0'-1];
				}else{
					ans="NA";
					break;
				}
			}
		}else{
			ans="NA";
		}
		cout<<ans<<endl;
	}
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string str[6]={"","aafkpuz","abglqv.","achmrw?"
		 ,"adinsx!","aejoty "};
  string str2;
  while(cin>>str2){
    if(str2.size()%2==1)
      cout<<"NA"<<endl;
    else{
      string ans="";
      for(int i=0;i<str2.size();i+=2){
	if(str2[i+1]-'0'<=5&&str2[i]-'0'<=6&&str2[i+1]-'0'>0&&str2[i]-'0'>0){
	ans+=str[str2[i+1]-'0'][str2[i]-'0'];
	}
	else{
	  ans="NA";
	}
      }
      cout<<ans<<endl;
    }
  }
  return 0;
}

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

int main() {
	string a;
	while (cin >> a) {
		
		if (a.length() % 2 == 1) { cout << "NA" << endl; continue; }
		string t = "";
		bool p =true;
		for (int b = 0; b < a.length(); b += 2) {
			if (a[b] > '6' || a[b]<'1' || a[b + 1]>'5' || a[b + 1] < '1') { cout << "NA" << endl; p = false; break; }
			int s = (a[b] - 49) * 5 + (a[b + 1] - 49) + 97;
			if (s < 123)t += (char)s;
			else {
				switch (s) {
				case 123:t += '.'; break;
				case 124:t += '?'; break;
				case 125:t += '!'; break;
				case 126:t += ' '; break;
				}
			}
		}
		if (p)cout << t << endl;
	}
}

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

string hyou[] = {"afkpuz",
		 "bglqv.",
		 "chmrw?",
		 "dinsx!",
		 "ejoty "};
int main(){
  string in;
  while(cin >> in){
    if(in.size()%2 == 1){
      cout << "NA" << endl;
      continue;
    }
    cout << in.size() << endl;  
        for(int i = 0 ; i < in.size() ; i+=2 ){
	  cout << hyou[in[i+1]-'0'-1][in[i]-'0'-1];
    }
	cout << endl;
  }
  return 0;
}

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

const string hyou[] = {"afkpuz",
		       "bglqv.",
		       "chmrw?",
		       "dinsx!",
		       "ejoty "};
int main(){
  string in;
  while(cin >> in){
    cin.ignore();
    if(in.size()%2 == 1){
      cout << "NA" << endl;
      continue;
    }
    bool flag = true;
    string ans = "";
        for(int i = 0 ; i < in.size()-1 ; i+=2 ){
	  if(!('1' <= in[i+1] && in[i+1] <= '6')||
	     !('1' <= in[i] && in[i] <= '5')){
	    flag = false; 
	    break;
	  }
	  ans += hyou[in[i+1]-'0'-1][in[i]-'0'-1];
    }
	if(flag)cout << ans <<endl;
	else cout << "NA" << 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 > 6 || smp2 > 5){
      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<bits/stdc++.h>
using namespace std;

int main(){
  char zu[6][5];
  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]=' ';
  while(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 || smp1 <= 0 || smp2 <= 0){
	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<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)){
        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<iostream>
using namespace std;

int main(){
  string mes;
  char code[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','.','?','!',' '} };

  while(cin>>mes){
    string ans;
    bool f = true;
    if(mes.size()&1)f = false;
    for(int i=0;i<(int)mes.size();i+=2){
      int c = mes[i]-'0'-1, r = mes[i+1]-'0'-1;
      if(c<0 || r<0 || c>=6 || r>=5)f = false;
      else ans += code[c][r];
    }
    if(f)cout << ans << endl;
    else cout << "NA" << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	char data[6][6]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
	string s;
	while(cin>>s){
		string ans;
		if(s.size()%2!=0){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<s.size();i+=2){
			int x=s[i]-'1',y=s[i+1]-'1';
			if(x<0||x>=6||y<0||y>=5){
				cout<<"NA"<<endl;
				continue;
			}
			ans+=data[x][y];
		}
		cout<<ans<<endl;
	}
}