#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

char buf[300];
int main() {
	while (~scanf("%s", buf)) {
		char*s = buf;
		string res;
		while (s < buf + strlen(buf)) {
			int d; sscanf(s, "%2d", &d);
			if (d <= 10 || 65 < d) { puts("NA"); goto p; }
			if (d <= 15)res += char(d + 86);
			else if (d <= 25)res += char(d + 81);
			else if (d <= 35)res += char(d + 76);
			else if (d <= 45)res += char(d + 71);
			else if (d <= 55)res += char(d + 66);
			if (d == 61)res += 'z';
			if (d == 62)res += '.';
			if (d == 63)res += '?';
			if (d == 64)res += '!';
			if (d == 65)res += ' ';
			s += 2;
		}
		cout << res;
	p:;
	}
}