#include <bits/stdc++.h>
int main() {
  int p = 0, tmp = 0, tmp0 = 0, tmp1 = 0, tmp2 = 0, outp = 0;
  char str[1000];
  scanf("%d", &p);
  gets(str);
  while (tmp < p) {
    gets(str);
    tmp0 = 0;
    while (1) {
      if (str[tmp0] == '\0' && str[tmp0] != ' ') break;
      tmp0++;
    }
    tmp2 = tmp0;
    printf("%d\n", tmp2);
    tmp0 = 0;
    while (str[(tmp0 + 6)] != '\0') {
      if (str[(tmp0)] == 'H' && str[(tmp0 + 1)] == 'o' &&
          str[(tmp0 + 2)] == 's' && str[(tmp0 + 3)] == 'h' &&
          str[(tmp0 + 4)] == 'i' && str[(tmp0 + 5)] == 'n' &&
          str[(tmp0 + 6)] == 'o') {
        str[(tmp0 + 6)] = 'a';
      }
      tmp0++;
    }
    puts(str);
    tmp++;
  }
  return 0;
}
