#include <bits/stdc++.h>
using namespace std;
bool check(string s, string target, int idx) {
  for (int i = 0; i < target.size(); i++) {
    if (s.length() <= idx + i) {
      return false;
    }
    if (s[idx + i] != target[i]) {
      return false;
    }
  }
  return true;
}
int main() {
  string s;
  int n;
  cin >> n;
  getline(cin, s);
  for (int i = 0; i < n; i++) {
    getline(cin, s);
    for (int i = 0; i < s.length(); i++) {
      if (check(s, "Hoshino", i)) {
        s[i + 6] = 'a';
      } else if (check(s, "Hoshina", i)) {
        s[i + 6] = 'o';
      }
    }
    cout << s << endl;
  }
}
