#include <iostream>

#include <vector>

#include <algorithm>

#include <sstream>

#include <string>

#include <cmath>

#include <list>

#include <set>
#include <cstdlib>
using namespace std;

int in() {int x; cin >> x; return x;}

template <typename T> class SegTree

{

public:

	int n;

	T T_max;

	vector<T> dat;

	SegTree(int n_, T t_max)

	{

		int n = 1;

		T_max = t_max;

		while (n < n_)n *= 2;

		for (int i = 0; i < 2 * n - 1; i++)dat.push_back(t_max);

	}

	void update(int k, T a)

	{

		k += n - 1;

		dat[k] = a;

		while (k > 0)

		{

			k = (k - 1) / 2;

			dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);

		}

	}



	//[a,b)

	T query(int a, int b)

	{

		return _query(a, b, 0, 0, n);

	}



private:

	T _query(int a, int b, int k, int l, int r)

	{

		if (r <= a || b <= l)return T_max;

		if (a <= l && r <= b)return dat[k];

		else

		{

			T vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);

			T vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);

			return min(vr, vl);

		}

	}

};

int main()
{
	string a = " abcdefghijklmnopqrstuvwxyz.?! ";
	string b;
	while (cin >> b)
	{
		string ans;
		if (b.size() % 2)
		{
			cout << "NA" << endl;
			continue;
		}
		for (int i = 0; i < b.size(); i += 2)
		{
			int A = b[i] - '0';
			int B = b[i + 1] - '0';
			A--;
			int C = A * 5 + B;
			if (C > 30)
			{
				ans = "NA";
				break;
			}
			ans += a[C];
		}
		cout << ans << endl;
	}
}