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<iostream>
#include<string>
using namespace std;
int main() {
	string s;
	while (cin >> s){
		if (s.size() % 2 != 0) { 
			cout << "NA";
			goto P;
		}
		for (int i = 0; i < s.size(); i += 2){
			if (s[i] == '1'){
				if (s[i + 1] == '1')cout.put('a');
				else if (s[i + 1] == '2')cout.put('b');
				else if (s[i + 1] == '3')cout.put('c');
				else if (s[i + 1] == '4')cout.put('d');
				else if (s[i + 1] == '5')cout.put('e');
				else{
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '2'){
				if (s[i + 1] == '1')cout.put('f');
				else if (s[i + 1] == '2')cout.put('g');
				else if (s[i + 1] == '3')cout.put('h');
				else if (s[i + 1] == '4')cout.put('i');
				else if (s[i + 1] == '5')cout.put('j');
				else {
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '3'){
				if (s[i + 1] == '1')cout.put('k');
				else if (s[i + 1] == '2')cout.put('l');
				else if (s[i + 1] == '3')cout.put('m');
				else if (s[i + 1] == '4')cout.put('n');
				else if (s[i + 1] == '5')cout.put('o');
				else
				{
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '4'){
				if (s[i + 1] == '1')cout.put('p');
				else if (s[i + 1] == '2')cout.put('q');
				else if (s[i + 1] == '3')cout.put('r');
				else if (s[i + 1] == '4')cout.put('s');
				else if (s[i + 1] == '5')cout.put('t');
				else {
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '5') {
				if (s[i + 1] == '1')cout.put('u');
				else if (s[i + 1] == '2')cout.put('v');
				else if (s[i + 1] == '3')cout.put('w');
				else if (s[i + 1] == '4')cout.put('x');
				else if (s[i + 1] == '5')cout.put('y');
				else {
					cout << "NA";
					goto P;
				}
			}
			else if (s[i] == '6'){
				if (s[i + 1] == '1')cout.put('z');
				else if (s[i + 1] == '2')cout.put('.');
				else if (s[i + 1] == '3')cout.put('?');
				else if (s[i + 1] == '4')cout.put('!');
				else if (s[i + 1] == '5')cout.put(' ');
				else
				{
					cout << "NA";
					goto P;
				}
			}
			else {
				cout << "NA";
				goto P;
			}
		}
	P:
		cout << endl;
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    string s, ans;
    while(cin >> s){
        int i = 0;
        char a;
        ans = "";
        while(i < s.size()){
            if(s.size() % 2){
                ans = "NA";
                break;
            }
            if(s[i] == '1'){
                a = ('a' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '2'){
                a = ('f' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '3'){
                a = ('k' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '4'){
                a = ('p' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '5'){
                a = ('u' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '6'){
                if(s[i + 1] == '1')
                    a = 'z';
                else if(s[i + 1] == '2')
                    a = '.';
                else if(s[i + 1] == '3')
                    a = '?';
                else if(s[i + 1] == '4')
                    a = '!';
                else if(s[i + 1] == '5')
                    a = ' ';
                else{
                    ans = "NA";
                    break;
                }
            }else{
                ans = "NA";
                break;
            }
            ans+= a;
            i+= 2;
        }
        cout << ans << endl;
    }
}

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

using namespace std;

bool isvalid(string s)
{
	if(s.length()%2==1)	return false;
	for(int i=0;i<s.length();i+=2){
		int c=s[i]-'0'-1,r=s[i+1]-'0'-1;
		if(!(0<=c && c<=5 && 0<=r && r<=4))	return false;
	}
	return true;
}

int main()
{
	char code[]="abcdefghijklmnopqrstuvwxyz.?! ";
	string s;
	while(cin>>s){
		if(isvalid(s)){
			for(int i=0;i<s.length();i+=2)
				cout<<code[(s[i]-'0'-1)*5+(s[i+1]-'0'-1)];
			cout<<endl;
		}
		else	cout<<"NA"<<endl;
	}

	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]<'0' || s[i]>'6' || s[i+1]<'0' || s[i+1]>'5'){
	ans="NA";
	break;
      }
      ans+=a[s[i]-'0'-1][s[i+1]-'0'-1];
      i++;
    }
    cout<<ans<<endl;
  }
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main(){
    char a[7][7] = {"","*abcde","*fghij","*klmno","*pqrst","*uvwxy","*z.?! "};
    char s[200];
    while(~scanf("%s",s)){
        bool flg = false;
        if(strlen(s)%2==1)flg = true;
        else{
            for(int i=0;i<strlen(s);i++){
                if(s[i]<49||s[i]>54){
                    flg = true;
                    break;
                }
            }
            if(!flg){
                for(int i=0;i<strlen(s);i+=2){
                    printf("%c",a[s[i]-48][s[i+1]-48]);
                }
            }
        }
        if(flg)printf("NA");
        printf("\n");
        strcpy(s,"");
    }
    return 0;
}

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

int main(){
	char g[42] = {97,102,107,112,117,122,98,103,108,113,118,46,99,104,109,114,119,63,100,105,110,115,120,33,101,106,111,116,121,32};
	string s,a;
	while(cin >> s,!cin.eof()){
		for(int i = 0;i < s.size();i += 2){
				int l = s[i] - '0', r = s[i+1] - '0';
				if(s.size() % 2 || l < 1 || r < 1 || l > 6 || r > 5){a = "NA";break;}
			a += g[r * 6 + l - 7];
		}
		cout << a << endl;
	}	
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	string str;
	char poke[5][7]={{"afkpuz"},{"bglqv."},{"chmrw?"},{"dinsx!"},{"ejoty "}};
	while(cin>>str){
		if(str.size()%2!=0)cout<<"NA"<<endl;
		else {
			string ans;
			bool kawa=0;
			for(int i=1;i<str.size();i+=2){
				if(str[i-1]-'1'<0||str[i-1]-'1'>5||str[i]-'1'<0||str[i]-'1'>5){
					kawa=1;
					break;
				}
				else ans+=poke[str[i]-'1'][str[i-1]-'1'];
			}
			if(kawa)cout<<"NA"<<endl;
			else cout<<ans<<endl;
		}
	}
	return 0;
}