#include <bits/stdc++.h>
using namespace std;
int main() {
  char* table = "abcdefghijklmnopqrstuvwxyz.?! ";
  char buf[512];
  while (cin.getline(buf, sizeof(buf)), !feof(stdin)) {
    if (strlen(buf) & 1) {
      puts("NA");
      continue;
    }
    char decode[256];
    memset(decode, 0, sizeof(decode));
    bool ok = true;
    for (int i = 0; buf[i] != '\0'; i += 2) {
      int c = buf[i] - '0' - 1;
      int r = buf[i + 1] - '0' - 1;
      if (c < 0 || r < 0 || c > 5 || c > 5) {
        ok = false;
        break;
      }
      decode[i / 2] = table[c * 5 + r];
    }
    if (ok)
      puts(decode);
    else
      puts("NA");
  }
  return 0;
}
