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

int main(){
	string chg = "abcdefghijklmnopqrstuvwxyz.?! ",s;
	while(cin >> s){
		if(s.length() % 2) {
			cout << "NA" << endl;
			continue;
		}
		string to = "";
		bool flag = true;
		for(int i = 0;i < s.length() / 2;i++){
			char a = s[i * 2],b = s[i * 2 + 1];
			if(a >= '1' && a <= '6' && b >= '1' && b <= '5'){
				int aa = a - '1',bb = b - '1';
				to += chg.substr(aa * 5 + bb,1);
			}
			else flag = false;
		}
		if(!flag) cout << "NA" << endl;
		else cout << to << endl;
	}
	return 0;
}