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

char change(char a, char b) {
  char ans;
  if(a == '1' && b == '1') ans = 'a';
  if(a == '1' && b == '2') ans = 'b';
  if(a == '1' && b == '3') ans = 'c';
  if(a == '1' && b == '4') ans = 'd';
  if(a == '1' && b == '5') ans = 'e';
  if(a == '2' && b == '1') ans = 'f';
  if(a == '2' && b == '2') ans = 'g';
  if(a == '2' && b == '3') ans = 'h';
  if(a == '2' && b == '4') ans = 'i';
  if(a == '2' && b == '5') ans = 'j';
  if(a == '3' && b == '1') ans = 'k';
  if(a == '3' && b == '2') ans = 'l';
  if(a == '3' && b == '3') ans = 'm';
  if(a == '3' && b == '4') ans = 'n';
  if(a == '3' && b == '5') ans = 'o';
  if(a == '4' && b == '1') ans = 'p';
  if(a == '4' && b == '2') ans = 'q';
  if(a == '4' && b == '3') ans = 'r';
  if(a == '4' && b == '4') ans = 's';
  if(a == '4' && b == '5') ans = 't';
  if(a == '5' && b == '1') ans = 'u';
  if(a == '5' && b == '2') ans = 'v';
  if(a == '5' && b == '3') ans = 'w';
  if(a == '5' && b == '4') ans = 'x';
  if(a == '5' && b == '5') ans = 'y';
  if(a == '6' && b == '1') ans = 'z';
  if(a == '6' && b == '2') ans = '.';
  if(a == '6' && b == '3') ans = '?';
  if(a == '6' && b == '4') ans = '!';
  if(a == '6' && b == '5') ans = ' ';
  return ans;
}

int main(void) {
  char c[200];
  char ans[100];
  int len = 0;
  while(scanf("%s", c) != EOF) {
    int cnt = 0;
    len = strlen(c);
    for(int i = 0 ; i < len ; i+=2) {
      ans[i] = change(c[i], c[i+1]);
    }
    if(len % 2 == 0) {
      for(int i = 0 ; i < len ; i+=2) {
	cout << ans[i];
      }
      cout << endl;
    }
    else cout << "NA" << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	string A[] = { "abcde","fghij","klmno","pqrst","uvwxy","z.?! " };
	for (string s; cin >> s;) {
		if (s.size() % 2) {
			cout << "NA" << endl;
			continue;
		}
		bool flag = false;
		string ans = "";
		for (int i = 0; i < s.size(); i += 2) {
			if (!('1' <= s[i] && s[i] <= '6' && '1' <= s[i + 1] && s[i + 1] <= '5')) {
				cout << "NA" << endl;
				flag = true;
				break;
			}
			ans += A[s[i] - '1'][s[i + 1] - '1'];
		}
		if (flag) {
			continue;
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
	int x,y,f;
	string str;
	const char *table[] = {"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
	while(cin >> str){
		string t,tmp;
		f = 1;
		if(str.size() % 2 == 0){
			for(int i = 0;i < str.size();i += 2){
				tmp = str[i];
				x = atoi(tmp.c_str()) - 1;
				tmp = str[i+1];
				y = atoi(tmp.c_str()) - 1;
				if(x > 5 || y > 4 || x < 0 || y < 0){
					cout << "NA" << endl;
					f = 0;
					break;
				}
				if(f) t += table[x][y];
			}
			if(f) cout << t << endl;
		}
		else{
			cout << "NA" << endl;
		}
	}
	return 0;
}

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

using namespace std;

static inline int in(){ int x; scanf("%d", &x); return x; }

int main()
{
  string s;
  while (cin >> s){
    bool ok = true;
    for (int i = 0; i < s.size(); i++){
      if (i % 2 == 0){
        if (s[i] < '1' || '6' < s[i]){
          ok = false;
          break;
        }
      }
      else {
        if (s[i] < '1' || '5' < s[i]){
          ok = false;
          break;
        }
      }
    }
    if (s.size() % 2 == 1 || !ok){
      puts("NA");
      continue;
    }
    char *table[6] = {
      "abcde",
      "fghij",
      "klmno",
      "pqrst",
      "uvwxy",
      "z.?! "
    };
    for (int i = 0; i < s.size(); i += 2){
      printf("%c", table[s[i] - '1'][s[i + 1] - '1']);
    }
    puts("");
  }

  return 0;
}

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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

map<string, char> mp;

void init() {
  mp["11"] = 'a';
  mp["12"] = 'b';
  mp["13"] = 'c';
  mp["14"] = 'd';
  mp["15"] = 'e';
  mp["21"] = 'f';
  mp["22"] = 'g';
  mp["23"] = 'h';
  mp["24"] = 'i';
  mp["25"] = 'j';
  mp["31"] = 'k';
  mp["32"] = 'l';
  mp["33"] = 'm';
  mp["34"] = 'n';
  mp["35"] = 'o';
  mp["41"] = 'p';
  mp["42"] = 'q';
  mp["43"] = 'r';
  mp["44"] = 's';
  mp["45"] = 't';
  mp["51"] = 'u';
  mp["52"] = 'v';
  mp["53"] = 'w';
  mp["54"] = 'x';
  mp["55"] = 'y';
  mp["61"] = 'z';
  mp["62"] = '.';
  mp["63"] = '?';
  mp["64"] = '!';
  mp["65"] = ' ';
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  init();
  string s;
  while (cin >> s) {
    string ans = "";
    int sz = s.size(), na = sz & 1;
    for (int i = 0; i < sz; i += 2) {
      string t = s.substr(i, 2);
      na |= mp.find(t) == mp.end();
      ans += mp[s.substr(i, 2)];
    }
    cout << (na ? "NA" : ans) << endl;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	string s;
	while (cin >> s) {
		if (s.size() % 2) { puts("NA"); continue; }
		string res;
		int pos = 0;
		while (pos + 1 < s.size()) {
			int d = stoi(to_string(s[pos] - 48) + to_string(s[pos + 1] - 48));
			if (d <= 10 || 65 < d) { puts("NA"); goto p; }
			if (d <= 15)res += (char)d + 86;
			else if (d <= 25)res += (char)d + 81;
			else if (d <= 35)res += (char)d + 76;
			else if (d <= 45)res += (char)d + 71;
			else if (d <= 55)res += (char)d + 66;
			if (d == 61)res += 'z';
			if (d == 62)res += '.';
			if (d == 63)res += '?';
			if (d == 64)res += '!';
			if (d == 65)res += ' ';
			pos += 2;
		}
		cout << res << endl;
	p:;
	}
}

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

const char symbol[4] = { '.', '?', '!', ' ' };

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		std::string res;
		bool f = true;

		if( s.size() & 1 )
			f = false;

		if( f )
		{
			for( int i = 0; i < s.size(); i += 2 )
			{
				if( s[i] < '0' || s[i] > '9' || s[i+1] < '0' || s[i+1] > '9' )
				{
					f = false; 
					break;
				}

				int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
				if( n > 29 )
				{
					f = false;
					break;
				}
				else
					res += n >= 26 ? symbol[n-26] : 'a' + n;
			}
		}
		
		std::cout << ( f ? res : "NA" ) << std::endl;
	}

	return 0;
}