Go: package main

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

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	n, _ := strconv.Atoi(stdin.Text())

	for i := 0; i < n; i++ {
		stdin.Scan()
		fmt.Println(strings.Replace(stdin.Text(), "Hoshino", "Hoshina", -1))
	}
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    int n;cin>>n;
    char c; scanf("%c",&c);
    rep(p,n){
        string s;
    getline(cin,s);
        rep(i,s.length()){
        int b=(int)s.find("Hoshino",i);
        if(b!=-1){s.replace(b,7,"Hoshina");i+=6;}
    }
        cout<<s<<endl;
    }
}

C++: fa

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

int main(){
	int n, j;
	cin >> n;
	char s[1001];
	gets(s);
	for (int i = 0; i < n; i++) {
		//string s;
		//cin >> s;
		gets_s(s);
		for (j = 0; j < 1000-6; j++) {
			if (s[j + 6] == 0)
				break;
			if (s[j] == 'H'&&s[j + 1] == 'o'&&s[j + 2] == 's'&&s[j + 3] == 'h'&&s[j + 4] == 'i'&&s[j + 5] == 'n'&&s[j + 6] == 'o')
				s[j + 6] = 'a';
		}
		cout << s << endl;
		for (j += 5; j >= 0; j--) {
			s[j] = 0;
		}
	}
	

}

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

using namespace std;

int main(void)
{
	int n;
	string a;
	string g = "Hoshino";

	cin >> n;
		cin.ignore();
		for (int i = 0; i < n; ++i){
			int x = 0;
			getline(cin, a);
			if ((x = a.find("Hoshino")) >= 0)
				a.replace(x, g.length(), "Hoshina");
			cout << a << endl;
		}
	
	return 0;
}

C++: #include<stdio.h>
int main(){
    int i,j,n,flag=0;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        for(i=0;;i++){
            scanf("%c",&a[i]);
if(a[i]=='\n'){
a[i]=0;
break;
}}
        for(i=0;a[i]!=0;i++){
            //printf("%d ",flag);
            if(flag==0){
                if(a[i]=='H')flag++;
            }
            else if(flag==1){
                if(a[i]=='o')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==2){
                if(a[i]=='s')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==3){
                if(a[i]=='h')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==4){
                if(a[i]=='i')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==5){
                if(a[i]=='n')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==6){
                if(a[i]=='o')a[i]='a';
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
        }
        for(i=0;a[i]!=0;i++)printf("%c",a[i]);puts("");
        for(i=0;a[i]!=0;i++)a[i]=0;
    }
    return 0;
}

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

int main(){
	int data;
	std::cin >> data;  //dataset
	std::cin.ignore();
	
	std::string mis = "Hoshino";
	std::string correct = "Hoshina";
	
	for(int i=0; i<data; ++i){
		std::string  sentence;
		
		std::getline(std::cin, sentence);
		
		std::string::size_type index = sentence.find(mis);
		
		if(index == std::string::npos){
			std::cout << sentence << std::endl;
		}else{
			while(index != std::string::npos){
				sentence.replace(index, mis.length(), correct);
				index = sentence.find(mis, index + correct.length());
			}
			std::cout << sentence << std::endl;
		}
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int ct;
	char *rp;
	char retu[1000],s[]="Hoshina";
	scanf("%d",&ct);
	fflush(stdin);
	for(int f1=0;f1<ct;f1++){
		gets(retu);
		while(1){
			if(strstr(retu,"Hoshino")==NULL){
				break;
			}
			if(rp=strstr(retu,"Hoshino")){
				rp+=6;
				*rp='a';
			}
		}
		printf("%s\n",retu);
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int main(){
int counter;
string n;
string hoshino="Hoshino";
cin>>counter;
cin.ignore();
for(int iii=0;iii<counter;iii++){
	getline(cin,n);
	string tmp="";
	for(int i=0;i<=max( 0,(int)n.size()-7 );i++){
		bool f=1;
		int cnt=0;
		for(int j=i;j<i+7;j++)if(n[j]!=hoshino[j-i])f=0;
		if(f)n[i+6]='a';
	}//endfor
	cout<<n<<endl;
}

	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int compare(const std::string& buf, const std::string& str)
{
}

int main(int argc, char const *argv[])
{
	int n;
	std::string str1 = "Hoshino";
	std::string str2 = "Hoshina";
	int len = 7;
	std::string s;
	std::getline(std::cin, s);
	std::stringstream ss(s);
	ss >> n;
	REP(i, n)
	{
		std::getline(std::cin, s);
		int k = 0;
		int l = s.length();
		while(k+7 <= l)
		{
			int n = 0;
			for (int j = 0; j < 7; j++)
			{
				if (s[k+j] != str1[j])
				{
					n = j+1;
					break;
				}
			}
			if (n == 0)
			{
				s[k + 6] = 'a';
				n = 7;
			}
			k += n;
		}
		std::cout << s << std::endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
 
int main()
{
    string str;
    int n;
     
    cin >> n;
    getline(cin, str);
    while (n--) {
        getline(cin, str);
        for (int j = 0; j <= (int)str.size()-7; j++) {
            string key = str.substr(j, 7), repl;
            if (key == "Hoshino") {
                repl = "Hoshina";
                for (int k = 0; k < n; k++) {
                    str[j+k] = repl[k];
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>


using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    cin.ignore(); // or use cin.get(); ignore() can be used as when you want to input data and segment them by "enter key", if no "ignore()", then it can be seen as the whole data
    
    string str;
    
    while (n--)
    {
        getline(cin, str);
        
        for (int i = 0; i < (int)str.size(); i ++ ) //because size() returned "unsigned int" type, so need to cast to "int"
        {
            if ("Hoshino" == str.substr(i, 7))
            {
                i += 6;
                cout<<"Hoshina";
            }
            else
            {
                cout<<str[i];
            }
        }
        
        cout<<endl;
    }
    
}

int main()
{
    Solution();
    return 0;
}