#include <bits/stdc++.h>
using namespace std;
int main() {
  for (string s; getline(cin, s);) {
    if (s.size() % 2) {
      goto err;
    } else {
      string o;
      for (int i = 0; i * 2 < s.size(); i++) {
        const char *t = "abcdefghijklmnopqrstuvwxyz.?! ";
        int idx = (s[i * 2] - '1') * 5 + s[i * 2 + 1] - '1';
        if (idx < 0 || idx >= 30) goto err;
        o += t[idx];
      }
      cout << o << endl;
      continue;
    }
  err:
    cout << "NA" << endl;
  }
  return 0;
}
