#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	string alpha = "abcdefghijklmnopqrstuvwxyz.?! ";
	char table[5][6];

	int t = 0;
	rep(i,6)
	{
		rep(j,5)
		{
			table[j][i] = alpha[t];
			t++;
		}
	}
	
	string s;
	while(cin >> s)
	{
		if(s.size()%2 != 0)
		{
			cout << "NA" << endl;
		}
		else
		{
			t = 0;
			bool flag = true;
			vector<char> v;
			while(true)
			{
				if(t >= s.size())
				{
					break;
				}
			
				int a = s[t] - '1';
				int b = s[t+1] - '1';

				if(0 <= a && a < 6 && 0 <= b && b < 5)
				{
					v.push_back(table[b][a]);
				}
				else
				{
					flag = false;
				}

				t += 2;
			}
			if(flag)
			{
				rep(i,v.size())
				{
					cout << v[i];
				}
				cout << endl;
			}
			else
			{
				cout << "NA" << endl;
			}
		}
	}
	return 0;
}