  if(a == '6' && b == '3') ans = '?';
  if(a == '6' && b == '4') ans = '!';
  if(a == '6' && b == '5') ans = ' ';
  
  return ans;
}

int main(void) {
  char c[200];
  char ans[100];
  int len = 0;
  while(scanf("%s", c) != EOF) {
    int cnt = 0;
    len = strlen(c);
    for(int i = 0 ; i < len ; i+=2) {
      ans[i] = change(c[i], c[i+1]);
    }
    if(len % 2 == 0) {
      for(int i = 0 ; i < len ; i+=2) {
	cout << ans[i];
      }
      cout << endl;
    }
    else cout << "NA" << endl;
  }
  return 0;
}   