#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    if (s.size() % 2) {
      puts("NA");
      continue;
    }
    string res;
    int pos = 0;
    while (pos + 1 < s.size()) {
      int d = stoi(to_string(s[pos] - 48) + to_string(s[pos + 1] - 48));
      if (d <= 10 || 65 < d) {
        puts("NA");
        goto p;
      }
      if (d <= 15)
        res += (char)d + 86;
      else if (d <= 25)
        res += (char)d + 81;
      else if (d <= 35)
        res += (char)d + 76;
      else if (d <= 45)
        res += (char)d + 71;
      else if (d <= 55)
        res += (char)d + 66;
      if (d == 61) res += 'z';
      if (d == 62) res += '.';
      if (d == 63) res += '?';
      if (d == 64) res += '!';
      if (d == 65) res += ' ';
      pos += 2;
    }
    cout << res << endl;
  p:;
  }
}
