#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)
	{
		bool flag = true;

		rep(i,s.size())
		{
			int x = s[i] - '0';
			if( x < 0 || x >= 7) flag = false; 
		}

		if(s.size()%2 != 0 || !flag)
		{
			cout << "NA" << endl;
		}
		else
		{
			t = 0;
			while(true)
			{
				if(t >= s.size())
				{
					break;
				}
			
				int a = s[t] - '1';
				int b = s[t+1] - '1';

				cout << table[b][a]; 
				t += 2;
			}
			cout << endl;
		}
	}
	return 0;
}