#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    if (s.size() % 2) {
      cout << "NA" << endl;
      continue;
    }
    for (int i = 0; i < s.size(); i++) {
      int k;
      if (s[i] > '6' || s[i] < '1' || s[i + 1] > '5' || s[i] < '1') {
        cout << "NA";
        break;
      }
      k = ((int)s[i] - 48) * 10;
      k += (int)s[i += 1] - 48;
      if (k == 65)
        cout << " ";
      else if (k == 64)
        cout << "!";
      else if (k == 63)
        cout << "?";
      else if (k == 62)
        cout << ".";
      else {
        if (k <= 15) {
          char c = k + 86;
          cout << c;
        } else if (k <= 25) {
          char c = k + 81;
          cout << c;
        } else if (k <= 35) {
          char c = k + 76;
          cout << c;
        } else if (k <= 45) {
          char c = k + 71;
          cout << c;
        } else if (k <= 55) {
          char c = k + 66;
          cout << c;
        } else
          cout << "z";
      }
    }
    puts("");
  }
  return 0;
}
