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++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  string t[] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};
  string s;
  while (cin >> s) {
    if (odd(s.size())) {
      cout << "NA" << endl;
      continue;
    }
    stringstream ss;
    for (int i = 0; i < s.size(); i += 2) {
      if (s[i] < '1' || '6' < s[i] || s[i + 1] < '1' || '6' < s[i + 1]) {
        cout << "NA" << endl;
        goto next;
      }
      ss << t[s[i] - '1'][s[i + 1] - '1'];
    }
    cout << ss.str() << endl;
  next:;
  }
}

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

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

C++: #include <bits/stdc++.h>

using namespace std;

string Input, Output;
const char ChangeTable[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',' ', };

bool solve(int len) {
	for (int i = 0; i < len; i += 2) {
		//cout << Input[i];
		if (Input[i]>'6' || Input[i]<'1' || Input[i + 1]>'5' || Input[i + 1] < '1') {
			return false;
		}
		//cout << ChangeTable[Input[i + 1] - '0' - 1][Input[i] - '0' - 1] << endl;
		Output += ChangeTable[Input[i+1] - '0'-1][Input[i] - '0'-1];
	}
	return true;
}

int main() {
	int len;

	while (cin >> Input) {
		len = Input.size();
		Output = "";
		if (len % 2 == 0 && solve(len)) {
			cout << Output << endl;
		}
		else {
			cout << "NA" << endl;
		}
		
	}

	return 0;
}

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

char s[6][6] = {
	"abcde",
	"fghij",
	"klmno",
	"pqrst",
	"uvwxy",
	"z.?! "
};

int main(void){
	string str;

	while(cin>>str){
		if(str.length() % 2 == 1){
			cout<<"NA\n";
			continue;
		}
		string ans = "";
		bool flg = false;
		for(int i=0;i<str.length();i+=2){
			if('1' > str[i] || str[i] >= '7' || '1' > str[i+1] || str[i+1] >= '7'){
				cout<<"NA\n";
				flg = true;
				break;
			}
			int a = str[i] - '1';
			int b = str[i+1] - '1';
			ans += s[a][b];
		}
		if(flg) continue;
		cout<<ans<<endl;
	}

	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	string str;
	while(getline(cin,str)){
		string res="";
		int i;
		if(str.size()%2>0){
			cout<<"NA"<<endl;
			continue;
		}
		for(i=0;i<str.size();i+=2){
			if(str[i]<'1'||'6'<str[i]||str[i+1]<'1'||'5'<str[i+1]){
				cout<<"NA"<<endl;
				goto a;
			}
			if(str[i]!='6'){
				res+='a'+(str[i]-'1')*5+str[i+1]-'1';
			}else{
				switch(str[i+1]){
				case '1':
					res+="z";
					break;
				case '2':
					res+=".";
					break;
				case '3':
					res+="?";
					break;
				case '4':
					res+="!";
					break;
				case '5':
					res+=" ";
					break;
				}
			}
		}
		cout<<res<<endl;
		a:;
	}
	return 0;
}

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 "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	string st;
	while (getline(cin,st)) {
		string ans;
		bool ok = true;
		if (st.size() % 2)ok = false;
		for (int i = 0; i < st.size(); ++i) {
			if (!isdigit(st[i]))ok = false;
			if ('0' == st[i] || '7' <= st[i])ok = false;
		}
		for (int i = 0; i < st.size() / 2; ++i) {
			string ast = st.substr(2 * i, 2);
			int num = (ast[0] - '1') * 5 + (ast[1] - '1');
			if (ast[1] >= '6')ok = false;
			if (0<=num&&num <= 25)ans += 'a' + num;
			else if (num == 26)ans += '.';
			else if (num == 27)ans += '?';
			else if (num == 28)ans += '!';
			else if (num == 29)ans += " ";
			else {
				ok = false;
				break;
			}
		}
		if (ok) {
			cout << ans << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}
	return 0;
}

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];
		cout<<endl;
	}
	return 0;
}