#include <bits/stdc++.h>
int main(void) {
  char str[256] = {0};
  while (scanf("%s", str) != EOF) {
    int i;
    if (strlen(str) % 2 == 1) {
      puts("NA");
      continue;
    }
    for (i = 0; str[i] != 0; i += 2) {
      int dec = (str[i] - '0') * 10 + str[i + 1] - '0';
      switch (dec) {
        case 62:
          putchar('.');
          break;
        case 63:
          putchar('?');
          break;
        case 64:
          putchar('!');
          break;
        case 65:
          putchar(' ');
          break;
        default:
          putchar((str[i] - '1') * 5 + str[i + 1] - '1' + 'a');
          break;
      }
    }
    putchar('\n');
    memset(str, 0, sizeof(str));
  }
  return 0;
}
