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

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

int main(void) {
  char c[201];
  char ans[201];
  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 <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>5)
			{
				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<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
  
using namespace std;
  
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
  
typedef vector<int> vi;
typedef pair<int,int> pii;
  
int main(void) {
  int i,j;
  string s;
  char a[6][6]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
  while(cin>>s){
    string ans="";
    if(s.size()%2){
      cout<<"NA"<<endl;
      continue;
    }
    rep(i,s.size()){
      if(s[i]<'1' || s[i]>'6' || s[i+1]<'1' || s[i+1]>'5'){
    ans="NA";
    break;
      }
      ans+=a[s[i]-'0'-1][s[i+1]-'0'-1];
      i++;
    }
    cout<<ans<<endl;
  }
}

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

int main()
{
	char tb[9][9];
	for(int i=1; i<=7; i++)
	for(int j=1; j<=6; j++)
		tb[i][j]='a'+(5*(i-1)+j-1);
		
	tb[6][2]='.';
	tb[6][3]='?';
	tb[6][4]='!';
	tb[6][5]=' ';
	
	string b;
	while(cin >> b)
	{
		string res;
		bool g=true;
		if(b.size()%2==1) g=false;
		else
		{
			for(int i=0; i<b.size(); i+=2)
			{
				int f=b[i]-'0', s=b[i+1]-'0';
				if(f<1||f>6||s<1||s>5)
				{
					g=false;
					break;
				}
				res+=tb[f][s];
			}
		}
		
		if(g) cout << res << endl;
		else cout << "NA" << endl;
		
	}
}

C++: #include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)
char c[201], d[101];
int main() {
	while (~scanf("%s", c)) {
		if (strlen(c) % 2 == 1) {
			printf("NA\n");
		}
		else {
			bool flag = false;
			for (int i = 0; i < strlen(c); i += 2) {
				int a = c[i] - 48, b = c[i + 1] - 48;
				if (a == 0 || a > 6 || b == 0 || b > 5) {
					printf("NA"); flag = true; break;
				}
				else {
					int e = (a - 1) * 5 + (b - 1);
					switch (e) {
					case 26: d[i / 2] = '.'; break;
					case 27: d[i / 2] - '?'; break;
					case 28: d[i / 2] = '!'; break;
					case 29: d[i / 2] = ' '; break;
					default: d[i / 2] = (char)(e + 97);
					}
				}
			}
			if (!flag) {
				for (int i = 0; i < strlen(c) / 2; i++) {
					printf("%c", d[i]);
				}
			}
			printf("\n");
		}
	}
	return 0;
}