#include<iostream>
#include<string>

const char symbol[4] = { '.', '?', '!', ' ' };

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		if( s.size() & 1 )
			std::cout << "NA" << std::endl;
		else
		{
			std::string res;
			bool f = true;

			for( int i = 0; i < s.size(); i += 2 )
			{
				if( s[i] < '0' || s[i] > '9' || s[i+1] < '0' || s[i+1] > '9' )
				{
					f = false; 
					break;
				}

				int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
				if( n < 0 || n > 29 )
				{
					f = false;
					break;
				}
				else
					res += n >= 26 ? symbol[n-26] : 'a' + n;
			}

			std::cout << ( f ? res : "NA" ) << std::endl;
		}
	}

	return 0;
}