Go: package main

import (
	"bufio"
	"os"
	"strings"
	"fmt"
		"strconv"
	)

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

int main(){
char w[8][7]={{"abcde"},{"fghij"},{"klmno"},{"pqrst"},{"uvwxy"},{"z.?! "}};
string st;
while(cin>>st){
	bool f=true;char W[200]={};

if(st.size()%2==1)cout<<"NA"<<endl;
else{
for(int i=0;i<(st.size());i+=2){
int x=st[i]-'0'-1;int y=st[i+1]-'0'-1;
W[i/2]=w[x][y];
if(x>5||x<0||y>4||y<0)f=false;
}

if(f==false)cout<<"NA"<<endl;
else cout<<W<<endl;
}
}
return 0;
}

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

int main()
{
	string table[5] = { "afkpuz", "bglqv.", "chmrw?", "dinsx!", "ejoty " };
	string s;
	int x,y;
	while (cin>>s)
	{
		int flg = 0;
		string ans="";
		if (s.size()%2==1)		//?????????????\???°?????´???
		{
			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'))	//??¨???????????§????????´???
				{
					y = s[i] - '0'-1;
					x = s[i + 1] - '0'-1;
					flg = 1;
					ans += table[x][y];
				}
			}
			if (flg)
			{
				cout << ans <<endl;
			}
			else
			{
				cout << "NA" <<endl;		//1????????§???????????§???????????´???
			}
		}
	}

	return 0;
}

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){
		if(!(s.length()%2))for(int i=0;i<(int)s.length();i+=2){
			if(1<=s[i]-'0'&&s[i]-'0'<=6&&1<=s[i+1]-'0'&&s[i+1]-'0'<=5)cout<<table[s[i]-'0'-1][s[i+1]-'0'-1];
			else {cout<<"NA";break;}
		}else{
			cout<<"NA";
		}
		cout<<endl;
	}
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string a="abcdefghijklmnopqrstuvwxyz.?! ";
	string b;
	char ans[100];
	while(cin>>b){
	int top=0;
	bool na=false;
	if(b.size()%2==1)
		na=true;
	for(int i=0;i<b.size()-1;i+=2){
		ans[top]=a[(b[i]-'1')*5+b[i+1]-'1'];
		top++;
		if(b[i]<'1'||b[i]>'6'||b[i+1]<'1'||b[i+1]>'5')
			na=true;
	}
	if(na==true)
		cout<<"NA"<<endl;
	else{
	for(int i=0;i<top;i++)
		cout<<ans[i];
	cout<<endl;
	}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stack>
#include<cstdio>
#include<map>
#include<functional>

using namespace std;

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>

using namespace std;

int main(){
	string s;
	int n;
	char mozi[10][10] = {"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
    bool flag=true;
    
	while(cin>>n){
	for(int i=0; i<n; i++)
	{
		cin>>s;
		if(s.size()%2==1)
		{
			puts("NA");
			continue;
		}
		else
		{
			char str[201],kari[200];
			long int length = s.length();
			s.copy(str,length,0);
			for(int i=0; i<s.size(); i+=2)
			{
                if(0 <= (int)str[i]-49 <= 5 && 0 <= (int)str[i+1]-49 <= 4)
                    kari[i]=mozi[ (int)str[i]-49 ][ (int)str[i+1]-49 ];
                else
                    flag=false;
			}
            if(flag==true)
            {
                for(int i=0; i<s.size(); i+=2)
                {
                    cout<<kari[i];
                }
            }
            else
            {
                cout<<"NA";
            }
            puts("");
		}
	}
    }
	return 0;
}

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

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	string s;
	while(cin >> s)
	{
		string ans;
		int sz=s.size();
		if(sz%2==1)
		{
			cout << "NA" << endl;
			continue;
		}
		for(int i=0;i<sz/2;i++)
		{
			int f=s[2*i]-'0',se=s[2*i+1]-'0';
			if(f<0||f>6||se<0||se>6)
			{
				cout << "NA" << endl;
				goto end;
			}
			if(f==6&&se>=2)
			{
				switch(se)
				{
					case 2:ans+='.';break;
					case 3:ans+='?';break;
					case 4:ans+='!';break;
					case 5:ans+=' ';break;
				}
			}
			else ans+='a'+(f-1)*5+se-1;
		}
		cout << ans << endl;
		end:;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <strstream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

int main(){
	string s;
	while(cin>>s)
	{
		if(s.size()%2!=0){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0; i<s.size() ;i++)
		{
			int k;
			k =  ((int)s[i]-48)*10;
			k += (int)s[i+=1]-48;
			if(k>66){
				cout<<"NA";
				break;
			}
			if(k==65)cout<<" ";
			else if(k==64)cout<<"!";
			else if(k==63)cout<<"?";
			else if(k==62)cout<<".";
			else{
				if(k<=15){
					char c=k+86;
					cout<<c;
				}
				else if(k<=25){
					char c=k+81;
					cout<<c;
				}
				else if(k<=35){
					char c=k+76;
					cout<<c;
				}
				else if(k<=45){
					char c=k+71;
					cout<<c;
				}
				else if(k<=55){
					char c=k+66;
					cout<<c;
				}
				else cout<<"z";
			}
		}
		puts("");
	}

	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	char* table = "abcdefghijklmnopqrstuvwxyz.?! ";
	char buf[512];
	while (cin.getline(buf, sizeof(buf)), !feof(stdin) && strlen(buf))
	{
		if (strlen(buf) & 1)
		{
			puts("NA");
			continue;
		}

		char decode[256];
		memset(decode, 0, sizeof(decode));
		bool ok = true;
		for (int i = 0; buf[i] != '\0'; i += 2)
		{
			int c = buf[i] - '0' - 1;
			int r = buf[i+1] - '0' - 1;
			if (c < 0 || r < 0 || c > 5 || c > 5)
			{
				ok = false;
				break;
			}

			decode[i/2] = table[c*5 + r];
		}
		if (ok)
			puts(decode);
		else
			puts("NA");
	}

	return 0;
}