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 <string>
using namespace std;

int main()
{
	string table[6] = { "abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! " };
	string s;
	int a,b;
	while (cin>>s)
	{
		int flg = 1;
		string ans;
		if (s.size()%2)		//??????????????????????\???°?????´???
		{
			cout << "NA" << endl;
		}
		else
		{
			for (int i = 0; i < s.size(); i += 2)
			{
				if ((s[i] < '1') || (s[i] > '6') || (s[i + 1] < '1') || (s[i + 1] > '5'))
				{
					flg = 0;		//??????????????????????????§???????????´???
				}
			}

			if (flg)
			{
				for (int i = 0; i < s.size(); i+=2)		//????????????????????¨????????????????????´???
				{
					a = s[i] - '0'-1;
					b = s[i + 1] - '0'-1;
					ans += table[a][b];
				}
				cout << ans <<endl;
			}
			else
			{
				cout << "NA" <<endl;
			}
		}
	}

	return 0;
}

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){
    string out;
    if(in.size()%2==0){
      rep(i,in.size()){
  if(in[i] == '\n')break;
	out += maze[in[i+1]-'0'-1][in[i]-'0'-1];
	i ++;
      }
      cout<<out<<endl;
    }else
      cout<<"NA"<<endl;
  }
}

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

int main()
{
	char change[6][6] = {
		"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "
	};
	
	char str[256];
	
	while (scanf("%s", str) != EOF){
		char str2[256];
		strcpy(str2, "");
		
		int i = 0;
		while (str[i] != '\0'){
			if (
			(str[i] < '1' || str[i] > '6') || 
			(str[i + 1] < '1' || str[i + 1] > '5')
			){
				strcpy(str2, "NA");
				break;
			}
						
			strncat(str2, &change[str[i] - '0' - 1][str[i + 1] - '0' - 1], 1);
			
			i += 2;
		}
		
		printf("%s\n", str2);
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stdlib.h>
using namespace std;
int main()
{
	string po[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', ' ' } };
	string s;

	while (cin >> s){
		if (s.size() % 2 == 1){
			cout << "NA" << endl;
		}
		else{
			for (int i = 0; i < s.size(); i += 2){
				string x, y;
				x = s[i + 1];
				y = s[i];
				cout << po[stoi(x)][stoi(y)];
			}
		}
cout<<endl;
	}
}

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

int main(){
    char map[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 err = false;
	for (int i = 0; i < s.size(); i++)
	    if (i % 2 && (s[i] > '5' || s[i] < '1')) err = true;
	    else if (i % 2 == 0 && (s[i] > '6' || s[i] < '1')) err = true;

	if (s.size() % 2 || err) cout << "NA" << endl;

	else for (int i = 0; i < s.size(); i+=2)
		 cout << map[s[i]-'0'-1][s[i+1]-'0'-1], cout << endl;
    }
}

C++: #include<iostream>
using namespace std;
char M[6][6]={
	"abcde",
	"fghij",
	"klmno",
	"pqrst",
	"uvwxy",
	"z.?! "
};
string s;
main()
{
	while(cin>>s)
	{
		if(s.size()%2)
		{
			cout<<"NA"<<endl;
			continue;
		}
		bool f=1;
		for(int i=1;i<s.size();i+=2)if(!(s[i]>='1'&&s[i]<='5'))f=0;
		for(int i=0;i<s.size();i+=2)if(!(s[i]>='1'&&s[i]<='6'))f=0;
		if(!f)
		{
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<s.size();i+=2)
		{
			cout<<M[s[i]-'1'][s[i+1]-'1'];
		}
		cout<<endl;
	}
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

string enc[5] = {"afkpuz","bglqv.","chmrw?","dinsx!","ejoty "};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int w,h;
  while(cin>>s){
    string ans ="";
    bool f = true;
    for(int i = 0; i < s.size();i+=2){
      w = s[i+1]-'0'-1;
      h = s[i]-'0'-1;
      if( !value(w,h,5,6)|| s.size() % 2){
        cout << "NA"<<endl;
        f = false;
        break;
      }
      ans += enc[w][h];
    }
    if(f) cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	char graph[42] = {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()){
		string ans = "";
		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){ans = "NA";break;}
			ans += graph[(s[i+1] - '0') * 7 + s[i]-'0'];
		}
		cout << ans << endl;
	}	
}

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

int main(){
	string s;
	while(cin >> s){
		if(s.size()%2!=0) {
			printf("NA\n");
			continue;
		}
		
		int now=0;
		
		while(now<s.size()){
			int a=s[now]-'0', b=s[now+1]-'0';
			int p=(a-1)*5+b-1;
			//printf("a,b,p=%d,%d,%d\n",a,b,p);
			
			if(p<=25) printf("%c", p+'a');
			else if(p==26) printf(".");
			else if(p==27) printf("?");
			else if(p==28) printf("!");
			else if(p==29) printf(" ");
			now+=2;	
		}
		
		printf("\n");
	}
	return 0;
}