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