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+i,7,"Hoshina");
    }
        cout<<s<<endl;
    }
return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdio.h>
#include <string>
#include <stdlib.h>

using namespace std;

int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

	int n;
	string s;
	getline(cin, s);
	n = atoi(s.c_str());

	for(int i = 0; i < n; i++) {
		string str;
		getline(cin, str);
		cout << str.length() << endl;
		for(int j = 0; j <= str.length() - 7; j++) {
			string sub;
			sub = str.substr(j, 7);
			cout << sub << endl;
			if( sub == "Hoshino" )
				str[j + 6] = 'a';

			
		}
		cout << str << endl;
	}
	
 
	//while (1){}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
  int n;
  cin>>n;
  cin.ignore();
  string line;
  string s = "Hoshina";
  while(getline(cin, line)){
    while(line.find("Hoshino")!=string::npos){
      line.replace(line.find("Hoshino"), s.size(), s);
    }
    cout<<line<<endl;
  }
  return 0;
}

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

int main(){
	string x;
	string::size_type pos;
	int i=0,n;
	cin >> n;
		x = "";
		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 <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
	for(int j = 0; j<= n; j++)
	{
	
		char s[MAX_SIZE];
		gets(s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hasina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}
		if(j != 0) cout << endl;
	}
	return 0;

}

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

int main(){
	std::string str;
	int num;
	int start = 0;

	std::cin >> num;

	for(int i=0; i<num; ++i){

		std::cin >> str;

		while(start != -1){

			if(start == 0){ //for first loop
				start = (int)str.find("Hoshino", start);
			}else{
				start = (int)str.find("Hoshino", start+8);
			}

			if(start != -1){ //for first loop
				str.replace(start, start+7, "Hoshina");
			}

		}

		std::cout << str << std::endl;
	}

}

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

using namespace std;

int main()
{
    string S;
    
    while(getline(cin, S))
    {
        while(S.find("Hoshino") != string::npos)
        {
            S.replace(S.find("Hoshino"), 7, "Hoshina");
        }
        
        cout << S << endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  string s;
  cin>>n;
  getline(cin,s);
  rep(i,n){
    getline(cin,s);
    rep(j,s.size()-6){if(s.substr(j,7)=="Hoshino")s[j+6]='a';}
    cout<<s<<endl;
  }


}

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

using namespace std;

string Permute(const string &src_str){
  int foundpos=0;
  string dst_str=src_str;
  while((foundpos=dst_str.find("Hoshino"))!=string::npos)
    dst_str[foundpos+6]='a';
  return dst_str;
}

int main(){
  int n;
  cin>>n;
  vector<string> dataset(n);
  cin.get();
  for(int i=0;i<n;i++){
    getline(cin,dataset[i]);
  }
  for(int i=0;i<n;i++)
    cout<<Permute(dataset[i])<<endl;

}

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

using namespace std;

int main(){
	int n=0;
	string str;
	cin >> n;
	getline(cin,str);
	for(int i=0;i<n;i++){
		getline(cin,str);
		if(str.find("Hoshino") != string::npos){
			str.replace(str.find("Hoshino"),7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;
}
/*
	bug.
	int n=0;
	string str;
	cin >> n;
	for(int i=0;i<=n;i++){
		getline(cin,str);
		if(str.find("Hoshino") != string::npos){
			str.replace(str.find("Hoshino"),7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;
	
	}
*/

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

int main(){
	int n;
	string in;
	cin >> n;
	for (int i = 0; i <= n;i++) {
		getline(cin, in);
		int hoshi = in.find("Hoshino");
		if (hoshi >= 0) {
			in.replace(hoshi, 7, "Hoshina");
		}
		cout << in << endl;
	}
	return 0;
}

C++: #include <iostream>
int main()
{
  int n;
  std::cin >> n;
  std::string line;
  std::getline(std::cin, line);
  while (n--) {
    std::getline(std::cin, line);
    
    int i;
    while ((i = line.find("Hoshino")) != std::string::npos) {
      line.replace(i, 7, "Hoshina");
    }
    std::cout << line << std::endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
    string str, judge = "";
    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++) {
            judge += str[j];
            if(str[j] < 'A' || str[j] > 'z' || str[j]==' ' ){
                cout << judge;
                judge = "";
            }
            if (judge == "Hoshino" && str[j + 1] >= 'A' && str[j + 1] <= 'z') {
                cout << judge;
                judge = "";
            }
            if (judge == "Hoshino") {
                cout << "Hoshina";
                judge = "";
            }
            else if (j == str.size() - 1) {
                cout << judge;
                judge = "";
            }
        }
        cout << endl;
    }
    return 0;
}

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

using namespace std;

int main(){
	
	int n;
	
	char str[2000];
	
	cin >> n;
	
	cin.ignore();
	
	for(int loop = 0; loop < n; loop++){
		gets(str);
		
		for(int i = 0; i <= 1000; i++){
			if(str[i] == 'H' && str[i + 1] == 'o' && str[i + 2] == 's' && str[i + 3] == 'h' && str[i + 4] == 'i' && str[i + 5] == 'n' && str[i + 6] == 'o'){
				str[i + 6] = 'a';
			}
			if(str[i] == '\0'){
				break;
			}
			cout << str[i];
		}
		
		cout << endl;
	}
	
	return 0;
}