Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	result := make([]string, n, n)

	for i := 0; i < n; i++ {
		scanner.Scan()
		input := scanner.Text()

		result[i] = strings.Replace(input, "Hoshino", "Hoshina", -1)
	}

	for _, v := range result {
		fmt.Println(v)
	}
}

C++: #include <iostream>
#include <string>

/**
* @brief インタフェース
*/
class IAizuPR
{
public:
    virtual std::string& executeEx() = 0;
};

/**
* @brief 文字列を操作する
*/
class AizuPR final : public IAizuPR
{
public:
    /**
    * @brief コンストラクタ
    */
    AizuPR(std::string& ss) :
        str(ss) ,
        bufCnt(0) {}

    /**
    * @brief デストラクタ
    */
    ~AizuPR() {}

public:
    /**
    * @fn std::string& executeEx()
    * @brief 文字列からHoshinoを検索し、Hoshinaへ変換する
    * @return std::string& 変換後の文字列
    */
    std::string& executeEx();

private:
    /**
    * @fn bool isFind(int& index)
    * @brief Hoshinoが含まれるか検索する
    * @param[out] index 開始位置
    * @return bool 含まれる場合はtrueを、そうでなければfalseを返す
    */
    bool isFind(int& index);

    /**
    * @fn void replace(int index)
    * @brief HoshinoをHoshinaに置き換える
    * @param[in] index 開始位置
    */
    void replace(int index);

private:
    //! "Hoshino"
    static const std::string Hoshino;

    //! "Hoshina"
    static const std::string Hoshina;

private:
    //! ターゲット文字列
    std::string str;

    //! バッファカウント
    int bufCnt;
};

/**
* @brief コントロール
*/
class Control
{
public:
    /**
    * @fn void executeEx()
    * @brief データセット回文字列を読み込み、HoshinoをHoshinaへ変換し、表示する
    */
    void executeEx();

};

const std::string AizuPR::Hoshino("Hoshino");
const std::string AizuPR::Hoshina("Hoshina");

std::string& AizuPR::executeEx()
{
    int tIdx = 0;
    std::string tStr(str);

    while (isFind(tIdx)) {
        replace(tIdx);
    }

    return str;
}

bool AizuPR::isFind(int& index)
{
    
    if (std::string::npos == (index = str.find(Hoshino, bufCnt))) {
        index = 0;
        return false;
    }

    bufCnt = index + Hoshina.length();

    return true;
}

void AizuPR::replace(int index)
{
    str.replace(index, Hoshino.length(), Hoshina);
}

void Control::executeEx()
{
    std::string in("");
    std::string out("");

    int size = 0;

    std::cin >> size;
    std::cin.ignore();

    for (int i = 0; i < size; i++) {
        std::getline(std::cin, in);

        IAizuPR* pAizuPR = new AizuPR(in);

        out = pAizuPR->executeEx();

        std::cout << out << std::endl;

        in.clear();

        out.clear();
        delete pAizuPR;
    }
}

/**
* @fn int main()
* @brief エントリポイント
*/
int main()
{
    Control().executeEx();
}

C++: #include <iostream>
#include <string>
 
using namespace std;
 
int main()
{
    int n;
	
    cin >> n;
    cin.ignore();
    for (int i = 0; i < n; i++){
		string str;
		int pos = 0;
        getline(cin, str);
        while (1){
            pos = str.find("Hoshino", pos);
            if (pos == -1)  break;
            str[pos + 6] = 'a';
        }
        cout << str << endl;
    }
    return (0);
}

C++: #include<iostream>
#include<string>
#include<cstring>
using namespace std;

int main(){
	string x;
	int pos;
	int n;
	cin >> n;
		cin.ignore();
		while (n--){
			cin >> x;
		while ((pos=x.find("Hoshino"))!= string::npos){
			x.replace(pos, 7, "Hoshina");
		}
		cout << x << endl;

	}
		return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <bitset>
using namespace std;
#define INF	100000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define SS stringstream
#define rep(i,n) for(int i = 0; i < n; i++)
#define sz(x) ((int)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).begin(), (x).end(), greater<int>() )
#define clr(a,b) memset((a),(b),sizeof(a))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<P> Vp;
typedef priority_queue<P, vector<P>, greater<P> > PQ;

int n;
string str;

int main(){
	cin >> n;
	cin.ignore();
	rep(i,n){
		getline(cin,str);
		rep(j,str.size()-6){
			if(str[j]=='H'&&str[j+1]=='o'&&str[j+2]=='s'&&str[j+3]=='h'&&str[j+4]=='i'&&str[j+5]=='n'&&str[j+6]=='o'){
				str[j+6]='a';
			}
		}
		cout << str << endl;
	}
}

C++: #include<cstdio>
#include<cstring>
#include<cctype>
#include<cstdlib>
using namespace std;
int main(){
    int w;
    scanf("%d",&w);
    getchar();
    for(int i = 0;i < w; i++){

        char str[1000]={0};

        scanf("%[^\n]",str);
        getchar();
        for(int j = 0;str[j] != 0; j++){
            if(str[j] == 'H'&&str[j+1] == 'o'&&str[j+2] == 's'&&str[j+3] == 'h'&&str[j+4] == 'i'&&str[j+5] == 'n'&&str[j+6] == 'o'){
                   str[j+6] = 'a';
               }
        }
        printf("%s\n",str);
    }
    return 0;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<bitset>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<cstdlib>
using namespace std;

string convert(string org){
	string name = "Hoshin";
	int i = 0;
	int j = 0;
	while(org[i]!=0){
		while(org[i]!=0 && name[j]!=0 && org[i]==name[j]){
			++i;++j;
		}
		if(j==name.size() && org[i]=='o'){
			org[i] = 'a';
		}
		++i;
		j = 0;
	}
	return org;
}

int main(){
	int n;
	string line;
	getline(cin,line);
	sscanf(line.c_str(),"%d",&n);
	for(int x=0;x<n;++x){
		getline(cin,line);
		line = convert(line);
		cout<<line<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int n;
string s;

int main(){
	cin >> n;
	cin.ignore();//?????????????????\??£????????????????¶??????????
	REP(i, n){
		getline(cin, s);
		bool f = 0;
		for (int i = 0; i < s.size() - 6; i++){
			string t = s.substr(i, 7);
			if (t == "Hoshino"){
				s[i + 6] = 'a';
			}
		}
		cout << s << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)

int main(void){
    int n;
    string h = "Hoshino";
    string s;
    cin >> n;
    getline(cin, s);
    stringstream ss(s);
    ss >> n;
    rep(loop, n) {
        getline(cin, s);
        rep(i, s.size()){
            if(i+h.size()-1 >= s.size()) break;
            bool same = true;
            rep(j, h.size()) {
                if(s[i+j]!=h[j]) {
                    same = false;
                    break;
                }
            }
            if(same) s[i+h.size()-1] = 'a';
        }
        cout << s << endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;

int main(){
    int n;
    cin>>n;
    cin.ignore();
    while(n--){
        string s;
        getline(cin,s);
        for(int i=6;i<s.length();i++)
            if(s[i]=='o'&&s[i-1]=='n'&&s[i-2]=='i'&&s[i-3]=='h'&&s[i-4]=='s'&&s[i-5]=='o'&&s[i-6]=='H')
                s[i]='a',s[i-1]='n',s[i-2]='i',s[i-3]='h',s[i-4]='s',s[i-5]='o',s[i-6]='H';
        cout<<s<<endl;
    }
}