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<bits/stdc++.h>
using namespace std;
int main(){
  string str[6]={"","aafkpuz","abglqv.","achmrw?"
		 ,"adinsx!","aejoty "};
  string str2;
  while(cin>>str2){
    if(str2.size()%2==1)
      cout<<"NA"<<endl;
    else{
      for(int i=0;i<str2.size();i+=2){
	cout<<str[str2[i+1]-'0'][str2[i]-'0'];
      }
      cout<<endl;
    }
  }
  return 0;
}

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

int main(){
	int x,y,f;
	string str;
	const char *table[] = {"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
	while(cin >> str){
		string t,tmp;
		f = 1;
		if(str.size() % 2 == 0){
			for(int i = 0;i < str.size();i += 2){
				tmp = str[i];
				x = atoi(tmp.c_str());
				tmp = str[i+1];
				y = atoi(tmp.c_str());
				if(x > 5 || y > 4 || x == 0 || y == 0){
					cout << "NA" << endl;
					f = 0;
					break;
				}
				if(f) t += table[x][y];
			}
			if(f) cout << t << endl;
		}
		else{
			cout << "NA" << endl;
		}
	}
	return 0;
}

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

int main()
{
  string s;

  for(;cin>>s;)
    {
      bool flag=true;
      string ans="";
      if(s.size()%2!=0)
	  flag=false;
      for(int i=0;i<s.size()&&flag;i+=2)
	{
	  if(s[i]>'6' ||s[i+1]>'5')
	    flag=false;

	  if(s[i]=='6')
	    {
	      if(s[i+1]=='1')
		ans+="z";
	      if(s[i+1]=='2')
		ans+=".";
	      if(s[i+1]=='3')
		ans+="?";
	      if(s[i+1]=='4')
		ans+="!";
	      if(s[i+1]=='5')
		ans+=" ";
	    }
	  else
	    {
	      int a=s[i]-'0';
	      int b=s[i+1]-'0';
	      char tmp='a'+(5*(a-1))+(b-1);
	      ans+=tmp;
	    }
	}
      
      if(flag)
	cout<<ans<<endl;
      else
	cout<<"NA"<<endl;
    }
}

C++: /*
	0127:Pocket Pager Input
*/
#include	<iostream>
#include	<string>

using namespace std;

const char WORDS[] = "abcdefghijklmnopqrstuvwxyz.?! ";

int main(void) {
	char WORDSET[6][5];
	int w = 0;
	
	for(int i = 0; i < 6; i++) {
		for(int j = 0; j < 5; j++) {
			WORDSET[i][j] = WORDS[w];
			w++;
		}
	}
	
	while(1) {
		string str;
		string ans;
		bool fl = true;
		
		cin >> str;
		
		if( cin.eof() ) { break; }
			else if( (int)str.size() % 2 != 0 ) { cout << "NA" << endl; continue; }
		string::iterator it = str.begin();
		while( it != str.end() ) {
			int a, b;
			
			a = *it - '0' - 1;
			it++;
			b = *it - '0' - 1;
			it++;
			
			if(0 <= a && a < 6 && 0 <= b && b < 5) {
				ans += WORDSET[a][b];
			} else {
				fl = false;
				break;
			}
		}
		if(fl) {
			cout << ans << endl;
		} else {
			cout << "NA" << endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string str[6]={"afkpuz","bglqv.","chmrw?"
		 ,"dinsx!","ejoty "};
  string str2;
  while(cin>>str2){
    if(str2.size()%2==1)
      cout<<"NA"<<endl;
    else{
      string ans="";
      for(int i=0;i<str2.size();i+=2){
	if(str2[i+1]-'0'<=5&&str2[i]-'0'<=6&&str2[i+1]-'0'>0&&str2[i]-'0'>0){
	ans+=str[str2[i+1]-'0'-1][str2[i]-'0'-1];
	}
	else{
	  ans="NA";
	  break;
	}
      }
      cout<<ans<<endl;
    }
  }
  return 0;
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include<string>
#include <sstream>
using namespace std;

//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
string str;
char mozi[100];
string d;
int e;
int use;
char i ='a';
int main()
{
  for(int j = 1; j <=6;j++){
    for(int l = 1;l <=5;l++){
      if(j ==6&&l >=2)
	break;
      mozi[j*10+l] =i++;
	 }
      }
    mozi[62] ='.';
    mozi[63] ='?';
    mozi[64] ='!';
    mozi[65] =' ';
  while(cin>>str){
    use = 0;
    for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      if(e >65||e <11){
	cout <<"NA"<<endl;
	use = e;
      }
    }
    if(use ==0){
    for(int i = 0;i <str.size();i+=2){
      d = str.substr(i, 2);
      e =toInt(d);
      cout<<mozi[e];
    }
    cout <<endl;
  } 
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std ;

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

main(){
	string s ;
	while( cin >> s ){
		if( cin.eof() ) break ;
		if( s.size() % 2 ){
			cout << "NA" << endl ;
			continue ;
		}
	
	for( int i=0 ; i<s.size() ; i+=2 ) cout << table[s[i+1]-'0'-1][s[i]-'0'-1] ;
	cout << endl ;
	}
}

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

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

C++: #include <iostream> 
#include <vector>
using namespace std;
int main(){
  char m = 'a';
  vector<char> str(31);
  for(int i = 1;i <= 26;i++){
    str[i] = 'a' + i-1;
  }
   
  str[27] = '.';
  str[28] = '?';
  str[29] = '!';
  str[30] = ' ';
  string line;
  while(cin >> line){
    string keep;
    if(line.size()%2 != 0){
      cout << "NA" << endl;
      continue;
    }
    int f = 0;
    for(int i = 0;i < line.size();i+=2){
      if((line[i+1] - '0' > 6 || line[i+1] - '0' < 1) || (line[i] - '0' > 6 || line[i] - '0' < 1)){
	cout << "NA" << endl;
	
	f = 1;
	break;
      }
      int tmp = (line[i+1]-'0')+((line[i]-'0'-1)*5);
      keep+= str[tmp];
    }
    if(f == 1)continue;
    cout << keep << endl;
  }


  return 0;
}

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

int main(void)
{
	int n;
	string instr;

	while(cin >> instr, !cin.eof()){
		if(instr.length() % 2){
			//cout << "NA" << instr.length() << endl;
			continue;
		}
		bool cannot = false;
		for(int i = 0; i < instr.length()-1; i+= 2){
			if(instr[i] < '1' || instr[i] > '6' || instr[i+1] < '1' || instr[i+1] > '5'){
				cannot = true;
				break;
			}
		}
		if(cannot){
			cout << "NA" << endl;
			continue;
		}
		for(int i = 0; i < instr.length()-1; i+=2){
			int a = instr[i]-'0', b = instr[i+1]-'0';
			int c = b+(a-1)*5;
			if(c <= 26)
				cout << (char)(c - 1+'a');
			else {
				switch(c%26){
					case 1:
						cout << '.';
						break;
					case 2:
						cout << '?';
						break;
					case 3:
						cout << '!';
						break;
					default:
						cout << ' ';
						break;
				}
			}

		}
		cout << endl;
			
	}

	return 0;
}