import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

void main(){

    string list = "abcdefghijklmnopqrstuvwxyz.?! ";
    while(true){
	string s = readln();
	if(stdin.eof()) break;
	s = s.chomp();
	if(s.length % 2 == 1){
	    writeln("NA");
	    continue;
	}
	string ans = "";
	for(int i=0;i<s.length/2;i++){
	    int c = to!int(s[2*i]-'0') - 1;
	    int r = to!int(s[2*i+1]-'0') - 1;
	    if(5<c || 4<r || c < 0 || r < 0){
		ans = "NA";
		break;
	    }
	    ans ~= list[5*c + r];
	}
	writeln(ans);
    }

}