#include <bits/stdc++.h>
using namespace std;
int compare(const std::string& buf, const std::string& str) {
  int l2 = str.length();
  int l1 = buf.length();
  for (int i = 0; i < l1 && i < l2; i++) {
    if (buf[i] == str[i]) {
      continue;
    }
    return i + 1;
  }
  return 0;
}
int main(int argc, char const* argv[]) {
  int n;
  std::string str1 = "Hoshino";
  std::string str2 = "Hoshina";
  int len = str1.length();
  scanf("%d\n", &n);
  for (int i = 0; i != int(n); i++) {
    std::string s;
    std::getline(std::cin, s);
    int k = 0;
    int l = s.length();
    while (k < l) {
      int ret = compare(s.substr(k), str1);
      if (ret == 0) {
        s[k + 6] = 'a';
        ret = len;
      }
      k += ret;
    }
    std::cout << s << std::endl;
  }
  return 0;
}
