#include <bits/stdc++.h>
using namespace std;
vector<string> keys;
vector<char> vals;
map<string, char> encoder;
bool AOJ0127() {
  string str, ret;
  cin >> str;
  if (str.size() % 2) {
    cout << "NA" << endl;
    return true;
  }
  for (int i = 0; i < (str.size() / 2); i++) {
    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 (int i = (1); i < (7); i++) {
    for (int j = (1); j < (6); j++) {
      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(' ');
  for (int i = 0; i < (keys.size()); i++) {
    encoder[keys[i]] = vals[i];
  }
  while (AOJ0127()) {
  }
  return 0;
}
