#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  getchar();
  while (n--) {
    cout << n << endl;
    vector<string> result;
    string line, word;
    getline(cin, line);
    istringstream stream(line);
    while (stream >> word) {
      if (word == "Hoshino") {
        result.push_back("Hoshina");
      } else {
        result.push_back(word);
      }
    }
    for (auto itr = result.begin(); itr != result.end(); ++itr) {
      cout << *itr << (itr + 1 == result.end() ? "\n" : " ");
    }
  }
}
