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 <iostream>
#include <string.h>
using namespace std;

int main() {
	
	char table[31] = "abcdefghijklmnopqrstuvwxyz.?! ",s[201];
	int i,l;
	
	while(cin>>s){
		l=strlen(s);
		if(l%2)
			cout<<"NA";
		else
			for(i=0;i<l;i+=2){
				if(s[i]<=54 && s[i+1]<=53)
					cout << table[(s[i]-49)*5+s[i+1]-49];
				else{
					cout<<"NA";break;
				}
			}
		cout<<endl;
	}
	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;
    else{
      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;
	  break;
	}
	ans += code[c][r];
      }
    }
    if(f)cout << ans << endl;
    else cout << "NA" << endl;
  }
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    string s, ans;
    while(cin >> s){
        int i = 0;
        char a;
        ans = "";
        while(i < s.size()){
            if(s.size() % 2 || (s[i] > '6' || s[i + 1] > '5')){
                ans = "NA";
                break;
            }
            if(s[i] == '6'){
                if(s[i + 1] == '1')
                    a = 'z';
                else if(s[i + 1] == '2')
                    a = '.';
                else if(s[i + 1] == '3')
                    a = '?';
                else if(s[i + 1] == '4')
                    a = '!';
                else if(s[i + 1] == '5')
                    a = ' ';
            }else{
                a = 'a' + (s[i + 1] - '1') + 5 * (s[i] - '1');
            }
            ans+= a;
            i+= 2;
        }
        cout << ans << 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){
    int flag=0;
    for(int i=0;i<s.size();i+=2){
      if('1'<=s[i] && s[i]<='6' && '1'<=s[i+1] && s[i+1]<='5'){
	flag=0;
      }else{
	flag=1;
      }
    }
    if(s.size()%2==0 && flag==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(){
  char c[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){
    string ans="";
    if(s.size()%2==0){
      for(int i=0;i<s.size();i+=2){
        if(s[i]>='1'&&s[i]<='6'&&s[i+1]>='1'&&s[i+1]<='6')
        ans+=c[s[i]-'0'-1][s[i+1]-'0'-1];
      else goto L;}
    cout<<ans<<endl;
}
    else L:cout<<"NA"<<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){
    int flag=0;
    for(int i=0;i<s.size();i+=2){
      if(s[i]>'6' || s[i]<'1' || s[i+1]>'5' || s[i+1]<'1'){
	flag=1;
      }
    }
    if(s.size()%2==0 && flag==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 <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include<string>
#include <sstream>
using namespace std;

//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
string str;
char mozi[100];
string d;
int e;
int use;
char i ='a';
int main()
{
  for(int j = 1; j <=6;j++){
    for(int l = 1;l <=5;l++){
      if(j ==6&&l >=2)
	break;
      mozi[j*10+l] =i++;
	 }
      }
    mozi[62] ='.';
    mozi[63] ='?';
    mozi[64] ='!';
    mozi[65] =' ';
  while(cin>>str){
    use = 0;
    for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      if(e >65||e <11){
	cout <<"NA"<<endl;
	use = e;
	break;
      }
    }
    if(use ==0){
    for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      cout<<mozi[e];
    }
    cout <<endl;
  } 
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string s;
	char ch[4] = {'.', '?', '!', ' '};
	while(cin >> s) {
		if(s.length()%2!=0) {
			cout << "NA" << endl;
			continue;
		}
		bool f = 0;
		rep(i,s.length()/2) {
			int x = s[2*i]-'0';
			if(x<1 && 6<x) {
				f=1; break;
			}
			int y = s[2*i+1]-'0';
			if(y<1 && 5<y) {
				f=1; break;
			}
			int ret = (x-1)*5+y; 
			if(ret<=26) cout << (char)('a'+ret-1);
			else cout << ch[ret-27];
		}
		if(f) cout << "NA";
		cout << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
string s[]={"afkpuz","bglqv.","chmrw?","dinsx!","ejoty "};
int main(){string ss;while(cin>>ss){
if(ss.size()%2==1){cout<<"NA"<<endl;continue;}
bool b=1;string ans="";for(int i=0;i<ss.size()-1;i+=2){
if(!('1'<=ss[i+1]&&ss[i+1]<='5')||!('1'<=ss[i]&&ss[i]<='6')){b=0; break;}
ans+=s[ss[i+1]-'0'-1][ss[i]-'0'-1];}
if(b)cout<<ans<<endl;else cout<<"NA"<<endl;
}}