#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
string str;
char mozi[66];
string d;
int e;
int use;
char i = 'a';
bool flag;
int main() {
  for (int j = 1; j <= 6; j++) {
    for (int l = 1; l <= 5; l++) {
      if (j == 6 && l >= 2) break;
      mozi[j * 10 + l] = i++;
    }
  }
  mozi[62] = '.';
  mozi[63] = '?';
  mozi[64] = '!';
  mozi[65] = ' ';
  while (cin >> str) {
    string ans;
    if (str.size() % 2) {
      cout << "NA" << endl;
    } else {
      flag = false;
      for (int i = 0; i < str.size(); i += 2) {
        d = str.substr(i, 2);
        e = toInt(d);
        ans += mozi[e];
        if (e < 11 || e > 65) {
          flag = true;
          break;
        }
      }
      if (flag) {
        cout << "NA" << endl;
      } else {
        cout << ans << endl;
      }
    }
    ans.clear();
  }
  return 0;
}
