#include <bits/stdc++.h>
using namespace std;
int main(void) {
  const char *table[] = {"afkpuz", "bglqv.", "chmrw\?", "dinsx!", "ejoty "};
  int n;
  cin >> n;
  for (int D = 0; D < n; ++D) {
    bool bNA = false;
    string s;
    cin >> s;
    if (s.length() % 2 == 1) {
      bNA = true;
      goto NA;
    }
    for (unsigned int l = 0; l < s.length(); l += 2) {
      int i = s[l + 1] - '0' - 1;
      int j = s[l] - '0' - 1;
      if (!(0 <= i && i <= 5) || !(0 <= j && j <= 5)) {
        bNA = true;
        goto NA;
      }
    }
  NA:;
    if (bNA) {
      cout << "NA\n";
      continue;
    }
    for (unsigned int l = 0; l < s.length(); l += 2) {
      int i = s[l + 1] - '0' - 1;
      int j = s[l] - '0' - 1;
      cout << table[i][j];
    }
    cout << '\n';
  }
  return 0;
}
