#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	char* table = "abcdefghijklmnopqrstuvwxyz.?! ";
	char buf[512];
	while (cin.getline(buf, sizeof(buf)), !feof(stdin) && strlen(buf))
	{
		if (strlen(buf) & 1)
		{
			puts("NA");
			continue;
		}

		char decode[256];
		memset(decode, 0, sizeof(decode));
		bool ok = true;
		for (int i = 0; buf[i] != '\0'; i += 2)
		{
			int c = buf[i] - '0' - 1;
			int r = buf[i+1] - '0' - 1;
			if (c < 0 || r < 0 || c > 5 || c > 5)
			{
				ok = false;
				break;
			}

			decode[i/2] = table[c*5 + r];
		}
		if (ok)
			puts(decode);
		else
			puts("NA");
	}

	return 0;
}