#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
    string str, judge = "";
    bool bo=false;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        if (i == 0) { getline(cin, str); }
        getline(cin, str);
        for (int j = 0; j < str.size(); j++) {
            if(str[j]=='H'||bo==true){
            judge += str[j];
                bo=true;
            }
            else{
                cout<<str[j];
            }
            if (judge == "Hoshino") {
                cout << "Hoshina";
                judge = "";
                bo=false;
            }
            else if(judge.size()==7 && judge!="Hoshino"){
                cout<<judge;
                judge="";
                bo=false;
            }
        }
        cout << endl;
    }
    return 0;
}