#include<string>
#include<iostream>

using namespace std;

bool isvalid(string s)
{
	if(s.length()%2==1)	return false;
	for(int i=0;i<s.length();i+=2){
		int c=s[i]-'0'-1,r=s[i+1]-'0'-1;
		if(!(0<=c && c<=5 && 0<=r && r<=4))	return false;
	}
	return true;
}

int main()
{
	char code[]="abcdefghijklmnopqrstuvwxyz.?! ";
	string s;
	while(cin>>s){
		if(isvalid(s)){
			for(int i=0;i<s.length();i+=2)
				cout<<code[(s[i]-'0'-1)*5+(s[i+1]-'0'-1)];
			cout<<endl;
		}
		else	cout<<"NA"<<endl;
	}

	return 0;
}