#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;
	}
}