#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum, x;
  string str;
  char abc[31] = {"abcdefghijklmnopqrstuvwxyz.?! "};
  while (cin >> str) {
    string ans = "";
    int num = 0;
    x = str.size();
    if (x % 2 != 0)
      cout << "NA" << endl;
    else {
      for (int i = 0; i < x; i++) {
        char c = str[i];
        if (i % 2 == 1) {
          if ((int)(c - '0') > 5) {
            num++;
            break;
          }
          sum = sum + (int)(c - '0');
          ans += abc[sum];
        } else {
          if ((int)(c - '0') > 6) {
            num++;
            break;
          }
          sum = (int)(c - '0');
          sum = (sum - 1) * 5 - 1;
        }
      }
      if (num == 0) {
        cout << ans << endl;
      } else {
        cout << "NA" << endl;
      }
    }
  }
  return 0;
}
