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 <algorithm>
#include <iostream>
#include <vector>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

//テ」ツδ榲」ツつッテ」ツδュテ・ツョツ堙ァツセツゥ
#define ALL(v) (v).begin(),(v).end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i,a,b) for(int i=(int)(a); i<(int)(b); ++i)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define SORT(x) sort(begin(x),end(x))
#define SELECT_SORT(x, n) sort(begin(x),begin(x)+n)
#define SWAP(type, a, b) do {type tmp = a; a = b; b = tmp;} while (0)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))

//テ・ツョツ堙ヲツ閉ー
#define INF 2000000000000
#define MAX 10

//DEBUGテァツ板ィ
#define BAR() cout << "----------------------------" << endl;
#define DUMP(v) (cerr << #v << ": " << v << endl)
#define PRINT(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

bool check(string input){
	int len = input.length();
	if(len % 2 == 0)
	{
		
		for(int i=0; i<len; i+=2)
		{
			int x = input[i] - '0';
			int y = input[i+1] - '0';
			if(x==0 || x > 6){return false;}
			if(y==0 || y > 5){return false;}
		}
		return true;
	}else{
		return false;
	}
}

int main()
{
	string table[10][10] = {{},
		                 {" ", "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 input="0";
	while(cin >> input)
	{
		int len = input.length();
		if(check(input))
		{
			
			for(int i=0; i<len; i+=2)
			{
				int x = input[i] - '0';
				int y = input[i+1] - '0';
				cout << table[x][y];
			}
			cout << endl;
		}
		else{
			cout << "NA" << endl;
		}
	}
}

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

using namespace std;

int main(void){

  string s;

  char h[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','.','?','!',' ' };
 back:
  while( cin >> s ){
    
    int l = s.size();
    if( l % 2 == 1 ){
      cout << "NA" << endl;
      continue;
    }
    
    int x[200] = {0},y[200] = {0},I = 0;
    for( int i = 0 ; i < l ; i += 2 ){
      x[I] = s[i] - '0';
      y[I] = s[i + 1] - '0';
      if( x[I] > 6 || y[I] > 5 || x[I] <= 0 || y[I] <= 0 ){
	cout << "NA" << endl;;
	goto back;
      }
      else{
	x[I]--;
	y[I]--;
      }
      I++;
    }
    for( int i = 0 ; i < I ; i++ ){
      cout << h[x[i]][y[i]];
    }
    cout << endl;
  }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

vector<string> keys;
vector<char> vals;
map<string, char> encoder;

bool AOJ0127()
{
	string str, ret;
	if(!(cin >> str)) return false;

	if (str.size() % 2) {
		cout << "NA" << endl;
		return true;
	}

	REP(i, str.size() / 2) {
		string buf = str.substr(2 * i, 2);
		if (encoder.find(buf) == encoder.end()) {
			cout << "NA" << endl;
			return true;
		}
		ret.push_back(encoder[buf]);
	}
	cout << ret << endl;

	return true;
}

int main()
{
	FOR(i, 1, 7) {
		FOR(j, 1, 6) {
			string key;
			key.push_back('0' + i);
			key.push_back('0' + j);
			keys.push_back(key);
		}
	}

	for (char c = 'a'; c <= 'z'; c++) {
		vals.push_back(c);
	}
	vals.push_back('.');
	vals.push_back('?');
	vals.push_back('!');
	vals.push_back(' ');

	REP(i, keys.size()) {
		encoder[keys[i]] = vals[i];
	}

	while (AOJ0127()) {

	}

	return 0;
}

C++: #include <iostream>

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 temp[2];

int main() {

    string mes;

    while (cin>>mes) {

        if (mes.length()%2!=0) cout << "NA" << endl;

        else {

            string res="";

            bool flag=false;
            for (int i=0; i<mes.length(); i++) {

                if (i%2!=0) {

                    temp[1] = mes[i] - '0';

                    if (temp[0]<1||temp[1]<1||temp[0]>6||temp[1]>6) {
                        flag = true;
                        break;
                    } else {
                        res += table[temp[0]-1][temp[1]-1];
                    }

                } else temp[0] = mes[i] - '0';

            }
            if (flag) cout << "NA" << endl;

            else cout << res << endl;

        }

    }

}

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

int main(){

  string s[5] = {"afkpuz","bglqv.","chmrw?","dinsx!","ejoty "};
  string t;
  int z,x,y;

  while(cin >> t){
    z = 0;

    if(t.size()%2 == 1){
      cout << "NA" << endl;
      continue;
    }

    for(int i=0;i<t.size();i++){
      if(i%2 == 0){
	if(t[i] < '1' || t[i] > '6'){
	  cout << "NA" << endl;
	  z = 1;
	  break;
	}
      }

      if(i%2 == 1){
	if(t[i] < '1' || t[i] > '5'){
	  cout << "NA" << endl;
	  z = 1;
	  break;
	}
      }
    }

    if(z == 1) continue;

    for(int i=0;i<t.size();i+=2){
      x = t[i] -'0'-1;
      y = t[i+1] - '0'-1;

      cout << s[y][x];
    }

    cout << endl;
  }
}