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>
using namespace std;
int main() {
 char a[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 b;
 while (cin >> b) {
  string c = "";
  if (b.length() % 2 == 1) {
   cout << "NA" << endl;
   goto stop;
  }
  int h, w;
  for (int i = 0; i < b.length() ; ) {
   h = (int)b[i++] - '0';
   w = (int)b[i++] - '0';
   if (h > 6 || w > 5) {
    cout << "NA" << endl;
    goto stop;
   }
   h--; w--;
   c += a[h][w];
   h = 0; w = 0;
  }
  cout << c << endl;
  stop:;
 }
}

C++: #include <iostream>
using namespace std;
int main(){
	char graph[6][7] = {{0,  0,  0,  0,  0,  0,  0},
											{0, 97,102,107,112,117,122},
											{0, 98,103,108,113,118,'.'},
											{0, 99,104,109,114,119,'?'},
											{0,100,105,110,115,120,'!'},
											{0,101,106,111,116,121,' '}};
	string s;
	while(cin >> s,!cin.eof()){
		if(s.size() % 2 == 1){cout << "NA" << endl;continue;};
		for(int i = 0;i < s.size();i += 2){
			if(s[i] - '0' <= 0 || s[i+1] - '0' <= 0 || s[i] - '0' > 6 || s[i+1] - '0' > 5){cout << "NA";break;}
			cout << graph[s[i+1]-'0'][s[i]-'0'];
		}
		cout << endl;
	}	
}

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

using namespace std;

int main(void){

  string s;

  char h[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','.','?','!',' ' };
 back:
  while( cin >> s ){
    
    int l = s.size();
    if( l % 2 == 1 ){
      cout << "NA" << endl;
      continue;
    }
    
    int x[200],y[200],I = 0;
    for( int i = 0 ; i < l ; i += 2 ){
      x[I] = s[i] - '0';
      y[I] = s[i + 1] - '0';
      if( x[I] > 6 || y[I] > 5 ){
	cout << "NA" << endl;;
	goto back;
      }
      else{
	x[I]--;
	y[I]--;
      }
      I++;
    }
    for( int i = 0 ; i < I ; i++ ){
      cout << h[x[i]][y[i]];
    }
    cout << endl;
  }
  return 0;
}

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++){
	text=text+ch[5*(nums[i*2]-49)+(nums[i*2+1]-49)];
      }
      cout<<text<<endl;
    }
  }
  return 0;
}

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


char decode(int a,int b){
	int x=a*5+b;
	if(x<26)return x+'a';
	return ".?! "[x-26];
}

int main(){
	string s;
	while(cin>>s){
		if(s.size()%2){
			cout<<"NA\n";
			continue;
		}
		for(int i=0;i<s.size();i+=2){
			cout<<decode(s[i]-'1',s[i+1]-'1');
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;
char table[6][7] = { { 0,0,0,0,0,0,0 },
{ 0,'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',' ' }
 };

int main()
{
//	cut here before submit 
//	freopen ("testcase.ppi", "r", stdin );
	string str = "";

	while (getline (cin, str ) ){

		string res = "";
		int len = str.length();
		int row, col;
		int i;
		bool notfound = false;

		if (len % 2 != 0 ){
			notfound = true;
		} // end if

		for (i = 0; i < len - 1; i += 2){
			col = str[i] - '0';
			row = str[i+1] - '0';
			if (col <= 0 || col >= 7 || row <= 0 || row >= 6 ){
				notfound = true;
			} // end if
		} // end for

		if (notfound ){
			cout << "NA" << endl;
			continue;
		} // end if

		for (i = 0; i < len - 1; i += 2){
			col = str[i] - '0';
			row = str[i+1] - '0';
			cout << table[row][col];
		} // end for
		cout << endl;
	} // end loop
		
	return 0;
}

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

int main(void){
  string tbl = "abcdefghijklmnopqrstuvwxyz.?! ";
  string msg, dec;
  int err;
  
  while (cin >> msg){
    if (msg.size()%2){ // msg length is odd
      cout << "NA" << endl;
      continue;
    }
    err = 0;
    dec = "";
    for (int i=0; i<msg.size(); i+=2){
      int n,m;
      n = msg[i]-'1';
      m = msg[i+1] - '1';
      if (n<0 || n>=6 || m<0 || m>=5){
        err = 1;
        break;
      }
      dec += tbl[n*5+m];
    }
    if (err){
      cout << "NA" << endl;
    } else {
      cout << dec << endl;
    }
  }
  return 0;
}

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

int main() {
	
	string table = "abcdefghijklmnopqrstuvwxyz.?! ",s,t;
	int i,l;
	
	while(cin>>s){
		l=s.length();
		t="";
		
		if(l%2)
			cout<<"NA";
		else{
			for(i=0;i<l;i+=2){
				if(s[i]<=54 && s[i+1]<=53)
					t += table[(s[i]-49)*5+s[i+1]-49];
				else{
					t="NA";break;
				}
			}
			cout<<t;
		}
			
		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;
		}
		string ret;
		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 code = (x-1)*5+y; 
			if(code<=26) ret += (char)('a'+code-1);
			else ret += ch[code-27];
		}
		if(f) cout << "NA" << endl;
		else cout << ret << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
char g[42]={97,102,107,112,117,122,98,103,108,113,118,46,99,104,109,114,119,63,100,105,110,115,120,33,101,106,111,116,121,32};
string s,a;
while(cin>>s,!cin.eof()){
for(int i=0;i<s.size();i+=2){
int l=s[i]-'0',r=s[i+1]-'0';
if(s.size()%2||l<1||r<1||l>6||r>5){a="NA";break;}
a+=g[r*6+l-7];
}
cout<<a<<endl;
}	
}

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

using namespace std;

int main(){
  string str;
  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 >> str){
    if(str.size() % 2){
      cout << "NA\n";
      continue;
    }
    string ans = "";
    for(int i = 0; i < str.size(); i += 2){
      if(str[i] < '1' || '6' < str[i] || str[i + 1] < '1' || '5' < str[i + 1]){
        ans = "NA";
        break;
      }
      ans += code[str[i] - '1'][str[i + 1] - '1'];
    }
    cout << ans << "\n";
  }
  return 0;
}