#include<iostream>
#include<string>
using namespace std;
int main(){
long l,i,k,f;
string s,t;
while(cin>>s){
l=s.size();t="";f=0;
for(i=0;i<l;i+=2){
if(49>s[i]||s[i]>54||49>s[i+1]||s[i+1]>53){f=1;break;}
k=(s[i]-48)*5+91+(s[i+1]-48);
/*cout<<"k="<<k<<endl;*/
if(s.substr(i,2)=="62")k=46;
else if(s.substr(i,2)=="63")k=63;
else if(s.substr(i,2)=="64")k=33;
else if(s.substr(i,2)=="65")k=32;
t+=k;
}
if(f==0)cout<<t<<endl;
else cout<<"NA"<<endl;
}
return 0;
}