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 <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

string a[]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};

int main(){
	string s;
	while(cin>>s){
		stringstream ss;
		if(s.size()%2){
			cout<<"NA\n";
			continue;
		}
		bool f=false;
		rep(i,s.size()){
			int x=s[i]-'0'-1,y=s[i+1]-'0'-1;
			if(!(-1<x&&x<6)||!(-1<y&&y<5)){
				cout<<x<<" "<<y<<endl;
				f=true;
				break;
			}
			ss<<a[x][y];
			i++;
		}
		if(f){
			cout<<"NA\n";
			continue;
		}
		string tmp;
		getline(ss,tmp);
		cout<<tmp<<endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	char graph[6][7] = {{0,  0,  0,  0,  0,  0,  0},
											{0, 97,102,107,112,117,122},
											{0, 98,103,108,113,118,'.'},
											{0, 99,104,109,114,119,'?'},
											{0,100,105,110,115,120,'!'},
											{0,101,106,111,116,121,' '}};
	string s;
	while(cin >> s,!cin.eof()){
		if(s.size() % 2 == 1){cout << "NA" << endl;continue;};
		for(int i = 0;i < s.size();i += 2){
			if(s[i] - '0' == 0 || s[i+1] - '0' == 0 || s[i] - '0' > 6 || s[i+1] - '0' > 5){cout << "NA";break;}
			cout << graph[s[i+1]-'0'][s[i]-'0'];
		}
		cout << endl;
	}	
}

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

int main(){
	char g[42] = {97,102,107,112,117,122,98,103,108,113,118,146,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<iostream>
#include<string>

using namespace std;

int Atoi(char);

int main(){
  int i, j, na , m, n;
  char c, data[5][6];
  string str, _str;

  c = 97;
  for(i=0; i<5; ++i){
    for(j=0; j<5; ++j){
      data[j][i] = c;
      ++c;
    }
  }
  data[0][5] = c;
  data[1][5] = '.';
  data[2][5] = '?';
  data[3][5] = '!';
  data[4][5] = ' ';

  while(cin >> str){
    if(str.size()%2 == 1){
      cout << "NA" << endl;
    }else{
      na = 0;
      for(i=0; i<str.size(); i+=2){
	if(str[i] > '6'||  str[i] < '1' || str[i+1] > '5' || str[i+1] < '1'){
	  cout << "NA" << endl;
	  na = 1;
	  break;
	}

	n = Atoi(str[i]);
	m = Atoi(str[i+1]);
	_str.push_back(data[m-1][n-1]);
      }

      if(na == 0)
 	cout << _str << endl;

      _str.clear();
    }
  }

  return 0;
}

int Atoi(char c){
  int x;
  x = c - 48;
  return x;
}

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

int main()
{
	string line;
	while(cin >> line)
	{
		if(line.size()%2==1)
		{
			cout << "NA" << endl;
			continue;
		}

		string str;
		for(int i=0; i<line.size(); i+=2)
		{
			if('1'<=line[i  ] && line[i  ]<='6'
			&& '1'<=line[i+1] && line[i+1]<='5')
			{
				     if(line[i]=='6' && line[i+1]=='2') str+='.';
				else if(line[i]=='6' && line[i+1]=='3') str+='?';
				else if(line[i]=='6' && line[i+1]=='4') str+='!';
				else if(line[i]=='6' && line[i+1]=='5') str+=' ';
				else str+=(line[i]-'1')*5+(line[i+1]-'1')+'a';
			}
			else
			{
				str = "NA";
				break;
			}
		}
		cout << str << endl;
	}
}

C++: #include<iostream>
using namespace std;
char M[6][6]={
	"abcde",
	"fghij",
	"klmno",
	"pqrst",
	"uvwxy",
	"z.?! "
};
string s;
main()
{
	while(cin>>s)
	{
		if(s.size()%2)
		{
			cout<<"NA"<<endl;
			continue;
		}
		bool f=1;
		for(int i=1;i<s.size();i+=2)if(s[i]>'5')f=0;
		for(int i=0;i<s.size();i+=2)if(s[i]>'6')f=0;
		if(!f)
		{
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<s.size();i+=2)
		{
			cout<<M[s[i]-'1'][s[i+1]-'1'];
		}
		cout<<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],y[200],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 ){
	cout << "NA";
	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++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	char table[20][20];
	string str;

	for(int i = 1; i <= 6; i++){
		for(int j = 1; j <= 5; j++){
			table[j][i]='a'+5*(i-1)+(j-1);
			if(i==6&&j==1)
				break;
		}
		if(i==6){
			table[2][6]='.';
			table[3][6]='?';
			table[4][6]='!';
			table[5][6]=' ';
		}
	}

	while(cin>>str){
		if(str.size()%2==1){
			cout<<"NA"<<endl;
			continue;
		}
		bool f=false;
		string cs;
		for(int i = 0; i < str.size(); i+=2){
			if(str[i]>='1'&&str[i]<='6'&&str[i+1]>='1'&&str[i+1]<='5'){
				cs+=table[str[i+1]-'0'][str[i]-'0'];
			}
			else{
				f=true;
				cout<<"NA"<<endl;
				break;
			}
		}
		if(f)
			continue;
		else{
			cout<<cs<<endl;
		}
	}

	return 0;
}

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

int main(){

  string s[6] = {"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(t[i] < '1' || t[i] > '6'){
	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;
  }
}

C++: #include<stdio.h>
#include<string.h>
char c[201];
char table[]="abcdefghijklmnopqrstuvwxyz.?! ";
char ret[101];
int main(){
	while(~scanf("%s",c)){
		int v=strlen(c);
		if(v%2){
			printf("NA\n");
			continue;
		}
		bool na=false;
		int now=0;
		for(int i=0;i<v/2;i++){
			if(c[i*2]>'6'||c[i*2]<'1'||c[i*2+1]>'5'||c[i*2+1]<'1'){
				na=true;
				break;
			}
			else{
				ret[now++]=table[(c[i*2]-'1')*5+(c[i*2+1]-'1')];
			}
		}
		ret[now]='\0';
		if(na)printf("NA\n");
		else printf("%s\n",ret);
	}
}