#include <bits/stdc++.h>
int main() {
  int dataSetNum;
  std::cin >> dataSetNum;
  std::vector<std::vector<std::string> > str;
  str.resize(dataSetNum);
  std::cin.ignore();
  for (int i = 0; i < dataSetNum; ++i) {
    std::string tmp;
    std::string buf;
    getline(std::cin, tmp);
    std::stringstream ss(tmp);
    while (getline(ss, buf, ' ')) {
      str[i].push_back(buf);
    }
  }
  for (int i = 0; i < dataSetNum; ++i) {
    std::replace_if(
        str[i].begin(), str[i].end(),
        [](std::string x) { return x == "Hoshino"; }, "Hoshina");
  }
  for (int i = 0; i < dataSetNum; ++i) {
    std::string tmp;
    tmp = str[i].front();
    std::for_each(str[i].begin() + 1, str[i].end(),
                  [&tmp](std::string x) { tmp += ' ' + x; });
    std::cout << tmp << std::endl;
  }
  return 0;
}
