#include<iostream>
#include<string>
using namespace std;
int main(){
	string a="abcdefghijklmnopqrstuvwxyz.?! ";
	string b;
	char ans[100];
	while(cin>>b){
	int top=0;
	bool na=false;
	if(b.size()%2==1)
		na=true;
	for(int i=0;i<b.size()-1;i+=2){
		ans[top]=a[(b[i]-'1')*5+b[i+1]-'1'];
		top++;
		if(b[i]<'1'||b[i]>'6'||b[i+1]<'1'||b[i+1]>'5')
			na=true;
	}
	if(na==true)
		cout<<"NA"<<endl;
	else{
	for(int i=0;i<top;i++)
		cout<<ans[i];
	cout<<endl;
	}
	}
	return 0;
}