#include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <strstream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

int main(){
	string s;
	while(cin>>s)
	{
		if(s.size()%2){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0; i<s.size() ;i++)
		{
			int k;
			
			if(s[i]>'6' || s[i]<'1' || s[i+1]>'5' || s[i]<'1'){
				cout<<"NA";
				break;
			}
			
			k =  ((int)s[i]-48)*10;
			k += (int)s[i+=1]-48;
			
			if(k==65)cout<<" ";
			else if(k==64)cout<<"!";
			else if(k==63)cout<<"?";
			else if(k==62)cout<<".";
			else{
				if(k<=15){
					char c=k+86;
					cout<<c;
				}
				else if(k<=25){
					char c=k+81;
					cout<<c;
				}
				else if(k<=35){
					char c=k+76;
					cout<<c;
				}
				else if(k<=45){
					char c=k+71;
					cout<<c;
				}
				else if(k<=55){
					char c=k+66;
					cout<<c;
				}
				else cout<<"z";
			}
		}
		puts("");
	}

	return 0;
}