#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int j = 0; j < n; j++) {
    string ss;
    getline(cin, ss);
    int len = ss.size();
    for (int i = 0; i < 1001; i++) {
      cout << ss[i];
      if (ss[i] == 'H') {
        if (ss.substr(i, 7) == "Hoshino") {
          ss[i + 6] = 'a';
          i += 6;
        }
      }
      if (ss[i] == '\0') break;
    }
    for (int i = 0; i < len; i++) {
      if (ss[i] == '\0') break;
      cout << ss[i];
    }
    cout << endl;
  }
  return 0;
}
