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 <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int hoge[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 s;
  while(cin>>s) {
    string ans;
    int i;
    for(i=0; i<s.length(); i+=2) {
      int a = s[i]-'1';
      int b = s[i+1]-'1';
      if (a<0||6<=a||b<0||5<=b) {
        ans = "NA";
        break;
      }
      ans += hoge[a][b];
    }
    cout << ans << endl;
  }
}

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

int main() {
	string a;
	while (1) {
	k:;
		cin >> a;
		if (cin.fail())break;
		if (a.length() % 2) { cout << "NA" << endl; continue;}
		for (int b = 0; b < a.length(); b += 2) {
			if (a[b]<'1' || a[b]>'6' || a[b + 1]<'1' || a[b + 1]>'5') { cout << "NA" << endl; goto k; }
			int s = (a[b] - 49) * 5 + (a[b + 1] - 49);
			if ((s + 97) < '{')	cout << (char)(s + 97);
			else {
				switch (s + 97) {
				case 123:cout << '.'; break;
				case 124:cout << '?'; break;
				case 125:cout << '!'; break;
				case 126:cout << ' '; break;
				}
			}
		}
		cout << endl;
	}
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	string s;
	vector<vector<char>>v(7, vector<char>(7));
	char a = 'a';
	rep(j, 1, 7) {
		rep(i, 1, 6) {
			v[i][j] = a++;
		}
	}

	v[2][6] = '.'; v[3][6] = '?'; v[4][6] = '!'; v[5][6] = ' ';
	rep(i, 0, 6)dumpc(v[i]);
	while (cin >> s) {
		if (s.size() & 1) {
			cout << "NA" << endl;
			continue;
		}
		bool f(false);
		//rep(i, 0, s.size()) {
		//	s[i] -= '0';
		//	if (i & 1) {
		//		if (s[i] >= 7)f = true;
		//	}
		//	else {
		//		if (s[i] >= 6)f = true;
		//	}
		//}
		//
		//if (f) {
		//	cout << "NA" << endl;
		//	continue;
		//}
		string ans;
		for (int i = 0; i + 1 < s.size(); i += 2) {
			ans += v[s[i + 1] - '0'][s[i] - '0'];
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>

using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+9
#define EPS 1e-9
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = j; i < (k); i++)
typedef long long ll;
char num[256];
char decode[][7] = {{0,0,0,0,0},
                   {0,'a','b','c','d','e'},
                   {0,'f','g','h','i','j'},
                   {0,'k','l','m','n','o'},
                   {0,'p','q','r','s','t'},
                   {0,'u','v','w','x','y'},
                   {0,'z','.','?','!',' '}};
string change(){
    if(strlen(num)%2 == 1)return "NA";
    string ans = "";
    for(int i = 0; i < strlen(num); i+=2){
        if('0' < num[i] && num[i] < '7' && '0' < num[i+1] && num[i+1] < '6')ans += decode[num[i]-48][num[i+1]-48];
        else return "NA";        
    }
    return ans;
}
int main(){
    while(~scanf("%s",num)){
        cout << change() << 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]<'1' || s[i]>'6' || s[i+1]<'1' || s[i+1]>'5'){
    ans="NA";
    break;
      }
      ans+=a[s[i]-'0'-1][s[i+1]-'0'-1];
      i++;
    }
    cout<<ans<<endl;
  }
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	char c[5] = {".?! "};
	string S;
	while(cin>>S){
		string ans;
		if(S.size()%2!=0){
			puts("NA"); goto NEXT;
		}
		for(int i=0;i<S.size();i+=2){
			if(!isdigit(S[i]) || !isdigit(S[i+1])){
				puts("NA"); goto NEXT;
			}
			int n = (S[i]-'0'-1)*5+(S[i+1]-'0'-1);
			if(n<26) ans += ('a'+n);
			else if(n<30) ans += c[n-26];
			else{
				puts("NA"); goto NEXT;
			}
		}
		cout<<ans<<endl;
		NEXT:;
	}
	return 0;
}

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

char s[6][6] = {
	"abcde",
	"fghij",
	"klmno",
	"pqrst",
	"uvwxy",
	"z.?! "
};

int main(void){
	string str;

	while(cin>>str){
		if(str.length() % 2 == 1){
			cout<<"NA\n";
			continue;
		}
		string ans = "";
		bool flg = false;
		for(int i=0;i<str.length();i+=2){
			if('1' > str[i] || str[i] >= '7' || '1' > str[i+1] || str[i+1] >= '6'){
				cout<<"NA\n";
				flg = true;
				break;
			}
			int a = str[i] - '1';
			int b = str[i+1] - '1';
			ans += s[a][b];
		}
		if(flg) continue;
		cout<<ans<<endl;
	}

	return 0;
}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>

using namespace std;

string T[6] =
{
    "",
    " afkpuz",
    " bglqv.",
    " chmrw?",
    " dinsx!",
    " ejoty "
};

void Solution(string str)
{
    if ( str.size() % 2 != 0 )  //input is should be even numbers
    {
        cout<< "NA" << endl;
        return;
    }
    
    string ans = "";
    
    for (int i = 0; i < (int)str.size(); i += 2)
    {
        int first = str[i] - '0';
        int second = str[i+1] - '0';
        
        if (1 <= first && first <= 6 && 1 <= second && second <= 5 )
        {
            ans += T[second][first];
        }
        else
        {
            cout << "NA" << endl;
            return;
        }
    }
    
    cout << ans << endl;
    
}

int main()
{
    string str;
    
    while(cin>>str)
    {
        Solution(str);
    }

    return 0;
}