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<algorithm>
#include<string>
#include<stdlib.h>
using namespace std;
int main()
{
	string po[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', ' ' } };
	string s;

	while (cin >> s){
		if (s.size() % 2 == 1){
			cout << "NA" << endl;
		}
		else{
			for (int i = 0; i < s.size(); i += 2){
				string x, y;
				x = s[i + 1];
				y = s[i];
				cout << po[stoi(x)][stoi(y)];
			}cout << endl;
		}
	}
}

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

char table[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', '.', '?', '!', ' '}
};

string translate(string s) {
    if (s.length() % 2 == 1) {
        return "NA";
    }
    for (int i = 0; i < s.length(); i++) {
        if (i % 2 == 1 && !('1' <= s[i] && s[i] <= '5')) {
            return "NA";
        }
        if (!('1' <= s[i] && s[i] <= '6')) {
            return "NA";
        }
    }
    string ts;
    for (int i = 0; i < s.length(); i+=2) {
        int a = s[i]   - '0' - 1;
        int b = s[i+1] - '0' - 1;
        ts.push_back(table[a][b]);
    }
    return ts;
}

int main() {
    string s;
    while (cin >> s) {
        cout << translate(s) << endl;
    }
    return 0;
}

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

char table[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 ){
		string ans;
		if( s.size()%2 ){
			cout << "NA" << endl;
		}else{
			bool flag = false;
			for(int i=1 ; i < s.size() ; i+=2 ){
				int y = s[i-1]-'0'-1;
				int x = s[i]-'0'-1;
				if( y < 0 || x < 0 || y >= 6 || x >= 5 ){
					flag = true;
					break;
				}
				ans += table[y][x];
			}
			if( flag )
				cout << "NA" << endl;
			else
				cout << ans << endl;
		}
	}
}