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

int main()
{	
	string s;

	while (cin >> s) {
		string u;

		if (s.size() % 2 == 1)
			cout << "NA" << endl;
		else {
			for (int i = 0; i < (int)s.size(); i += 2) {

				int t = stoi(s.substr(i, 2));

				if (t / 10 < 1 || t / 10 > 6 || t % 10 > 5) {
					u = "NA";
					break;
				}

				t = t / 10 * 5 + t % 10 + 91;

				if (t == 123)
					t = 46;
				else if (t == 124)
					t = 63;
				else if (t == 125)
					t = 33;
				else if (t == 126)
					t = 32;

				u += (char)t;
			}
			cout << u << endl;
		}
	}

	return 0;
}

