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;
		}
		else 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>
using namespace std;

int main(){
	char p[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',' '}};
	string a;	
	while(cin >> a){
		bool flag = false;
		for(size_t i=0;i<a.size();i+=2){
			if(a[i]>'6')
				flag = true;
			if(a[i+1]>'5')
				flag = true;
		}
		if(flag||a.size()%2){
			cout << "NA" << endl;
		}else{
			for(size_t i=0;i<a.size();i+=2){
				cout << p[a[i+1]-'0'-1][a[i]-'0'-1];
			}
			cout << endl;
		}
	}
}

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]>='1' && str[i]<='6' && str[i+1]>='1' && str[i+1]<='5'){
					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';
				}else{
					ch=false;
					break;
				}
			}
			if(ch==true)cout << ans << endl;
			else cout << "NA" << endl;
		}
	}
    return 0;
}

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

char s[99]="abcdefghijklmnopqrstuvwxyz.?! ############################";
int main(){
	string t;
	while(cin>>t){
		int f = 1;
		string ans;
		for(int i=0;i<t.size();i+=2){
			if(t[i] < '1' || '6' < t[i] || t[i+1] < '1' || '5' < t[i+1]){
				f = 0; break;
			}
			ans.push_back(s[(t[i]-'1')*5+t[i+1]-'1']);
		}
		if(!f) cout << "NA" << endl;
		else cout << ans << endl;
	}
}

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

const string table[] = {"0", "1abcde", "2fghij", "3klmno", "4pqrst", "5uvwxy", "6z.?! "};

int main()
{
  string s;
  while (cin >> s) {
    bool valid = true;
    if (s.size() & 1)
      valid = false;

    string ans = "";
    for (unsigned int i = 0; i < s.size() && valid; i += 2) {
      int row = s[i] - '0', col = s[i+1] - '0';
      if (0 < row && row <= 6 && 0 < col && col <= 5)
	ans += table[row][col];
      else
	valid = false;
    }

    if (valid)
      cout << ans << endl;
    else
      cout << "NA" << endl;
  }
  return 0;
}