#include <iostream>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string s;
	char ch[4] = {'.', '?', '!', ' '};
	while(cin >> s) {
		if(s.length()%2!=0) {
			cout << "NA" << endl;
			continue;
		}
		string ret;
		bool f = 0;
		rep(i,s.length()/2) {
			int x = s[2*i]-'0';
			if(x<1 || 6<x) {
				f = 1;
				break;
			}
			int y = s[2*i+1]-'0';
			if(y<1 || 5<y) {
				f = 1;
				break;
			}
			int code = (x-1)*5+y; 
			if(code<=26) ret += (char)('a'+code-1);
			else ret += ch[code-27];
		}
		if(f) cout << "NA" << endl;
		else cout << ret << endl;
	}
	return 0;
}