#include <bits/stdc++.h>
int main(void) {
  char str[200] = {0};
  int len;
  int i;
  int flag = 0;
  while (scanf("%s%*c", str) != EOF) {
    len = strlen(str);
    if (len % 2 == 1) {
      printf("NA\n");
      continue;
    }
    for (i = 0; i < len; i += 2) {
      if (str[i] > '6' || str[i + 1] > '5') {
        flag = 1;
        printf("NA\n");
        break;
      }
    }
    if (flag == 1) {
      flag = 0;
      continue;
    }
    i = 0;
    while (str[i] != '\0') {
      switch ((str[i] - 48) * 5 + str[i + 1] - 48) {
        case 32:
          printf(".");
          break;
        case 33:
          printf("?");
          break;
        case 34:
          printf("!");
          break;
        case 35:
          printf(" ");
          break;
        default:
          printf("%c", (str[i] - 48) * 5 + str[i + 1] + 91 - 48);
          break;
      }
      i = i + 2;
    }
    printf("\n");
    i = 0;
    while (str[i] != '\0') {
      str[i] = 0;
      i++;
    }
  }
  return 0;
}
