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;
char m[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){
    int i,j,k,l = s.length();
    if(l % 2 == 1) {
      cout << "NA" << endl;
      continue;
    }
    char t[102];
    for(i=0; i<l/2; i++){
      j = s[i*2] - '0' - 1;
      k = s[i*2+1] - '0' - 1;
      if(j > 5 || k > 4) {
	cout << "NA" << endl;
	break;
      }
      t[i] = m[j][k];
    }
    if(i >= l/2) {
      t[i] = '\0';
      cout << t << endl;
    }
  }
  return 0;
}

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

int main() {
  char table[5][7] = {{'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 a = "\0";
  while (getline(cin, a)) {
    int len = 0;
    for (int i = 0; a[i] != '\0'; i++)
      len++;

    if (len % 2) {
      cout << "NA" << endl;
      continue;
    }
    int count = 0;
    int count2 = 0;
    char ans[100] = {'\0'};
    while (count < len) {
      if (a[count] > 6 + '0' || a[count + 1] > 5 + '0' || a[count] < '1'
	  || a[count + 1] < '1') {
	cout << "NA" << endl;
	goto loop_end;
      }
      ans[count2] = table[a[count + 1] - '0' - 1][a[count] - '0' - 1];
      count += 2;
      count2++;
    }
    cout << ans << endl;
  loop_end: ;
    a = "\0";
  }
}

C++: #include <iostream>

using namespace std;

char table[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() {

  string buf;


  while(getline(cin,buf)) {

    if(buf.size()%2==1) goto NA;

    for(int i=0;i<buf.size();i++) {

      if(i%2==0 && ((buf[i]-'0')<1 || (buf[i]-'0')>6)) goto NA;

      if(i%2==1 && ((buf[i]-'0')<1 || (buf[i]-'0')>5)) goto NA;

    }

    for(int i=0;i<buf.size()/2;i++) {

      cout << table[(buf[2*i+1]-'0'-1)][(buf[2*i]-'0'-1)];

    }

    cout << endl;

    continue;


  NA:
    cout << "NA" << endl;

  }

  return 0;

}

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

int main() {
    string str;
    vector<string> vs = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! "};
    while (cin >> str) {
        if (str.size() % 2) {
            cout << "NA" << endl;
            continue;
        }
        string ans;
        for (int i = 0; i < str.size(); i+=2) {
            int a = str[i] - '0' - 1;
            int b = str[i+1] - '0' - 1;

            if (a < 6 && b < 5) {
                ans += vs[a][b];
            } else {
                ans = "NA";
                break;
            }
         }

        cout << ans << endl;
    }

    return 0;
}

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

int main(){
	string map[6];
	map[0] = "abcde";
	map[1] = "fghij";
	map[2] = "klmno";
	map[3] = "pqrst";
	map[4] = "uvwxy";
	map[5] = "z.?! ";
	string str;
	while(cin >> str){
		int num[1000]={0};
		int len = str.size();
		if(len%2 == 1){
			cout << "NA" << endl;
			continue;
		}
		for(int i=0;i<len;i+=2){
			for(int j=i;j<i+2;j++){
				string tmp = "";
				tmp += str[j];
				istringstream ss(tmp);
				ss >> num[j];
				//cout << num[j] << endl;
			}
		}
		for(int i=0;i<len;i+=2){
			cout << map[num[i]-1][num[i+1]-1];
		}
		cout << endl;
	}
}

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

using namespace std;

char META_CHARACTER[] = "z.?! ";

int main(void){
	for(string in, out; cin >> in; cout << out << endl){
		out.clear();
		if(in.length() % 2){ out = "NA"; continue; }

		for(int i = 0; i < in.length(); i += 2){
			int col = in.at(i) - '1';
			int row = in.at(i + 1) - '1';

			if(col < 0 || 5 < col ||
			   row < 0 || 4 < row){ out = "NA"; break; }

			if(col == 5){ out.push_back(META_CHARACTER[row]); }
			else{ out.push_back('a' + 5 * col + row); }
		}
	}
		
		
	return 0;
}

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

int main(void){
	string str;
	while(cin >> str){
		string ans;
		bool ch=true;
		if(str.size()%2==1)cout << "NA" << endl;
		else{
			for(int i=0;i<str.size();i+=2){
				if(str[i]>='7' || str[i+1]>='7'){
					ch=false;
					break;
				}else{
					if(str[i]=='6' && str[i+1]=='2')ans+=".";
					else if(str[i]=='6' && str[i+1]=='3')ans+="?";
					else if(str[i]=='6' && str[i+1]=='4')ans+="!";
					else if(str[i]=='6' && str[i+1]=='5')ans+=" ";
					else ans+=(str[i]-'1')*5+(str[i+1]-'1')+'a';
				}
			}
			if(ch==true)cout << ans << 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 <cstring>
#include <cstdlib>
using namespace std;
int main()
{
	int i;
	char c, d, s[201], r[101], t[5][7] = {"afkpuz", "bglqv.", "chmrw?", "dinsx!", "ejoty "};
	while (cin >> s)
	{
		if (cin.eof()) break;
		if (strlen(s)%2 == 0)
		{
			for (i = 0; i < strlen(s); i += 2)
			{
				c = s[i], d = s[i+1];
				if (atoi(&c) > 6 || atoi(&d) > 5)
				{
					cout << "NA" << endl;
					break;
				}
				r[i/2] = t[atoi(&d)-1][atoi(&c)-1];
			}
			r[i/2] = '\0';
			cout << r << endl;
		}
		else
			cout << "NA" << endl;
	}
}