#include <iostream>
#include <string>
using namespace std;

int main() {
	
	string table = "abcdefghijklmnopqrstuvwxyz.?! ",s,t;
	int i,l;
	
	while(cin>>s){
		l=s.length();
		t="";
		
		if(l%2)
			t="NA";
		else
			for(i=0;i<l;i+=2){
				if(s[i]<=54&&s[i]>=49&&s[i+1]<=53&&s[i+1]>=49)
					t += table[s[i]*5+s[i+1]-294];
				else{
					t="NA";break;
				}
			}
		cout<<t<<endl;
	}
	return 0;
}