#include <bits/stdc++.h>
const char symbol[4] = {'.', '?', '!', ' '};
int main() {
  std::string s;
  while (std::cin >> s) {
    std::string res;
    bool f = true;
    if (s.size() & 1) f = false;
    for (int i = 0; i < s.size(); i += 2) {
      int n = (s[i] - '1') * 5 + s[i + 1] - '1';
      if (n > 29)
        f = false;
      else
        res += n >= 26 ? symbol[n - 26] : 'a' + n;
      if (!f) break;
    }
    std::cout << (f ? res : "NA") << std::endl;
  }
  return 0;
}
