#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

vector<string> keys;
vector<char> vals;
map<string, char> encoder;

bool AOJ0127()
{
	string str, ret;
	if(!(cin >> str)) return false;

	if (str.size() % 2) {
		cout << "NA" << endl;
		return true;
	}

	REP(i, str.size() / 2) {
		string buf = str.substr(2 * i, 2);
		if (encoder.find(buf) == encoder.end()) {
			cout << "NA" << endl;
			return true;
		}
		ret.push_back(encoder[buf]);
	}
	cout << ret << endl;

	return true;
}

int main()
{
	FOR(i, 1, 7) {
		FOR(j, 1, 6) {
			string key;
			key.push_back('0' + i);
			key.push_back('0' + j);
			keys.push_back(key);
		}
	}

	for (char c = 'a'; c <= 'z'; c++) {
		vals.push_back(c);
	}
	vals.push_back('.');
	vals.push_back('?');
	vals.push_back('!');
	vals.push_back(' ');

	REP(i, keys.size()) {
		encoder[keys[i]] = vals[i];
	}

	while (AOJ0127()) {

	}

	return 0;
}