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 <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	int n;
	cin>>n;
	int cnt=0;
	string str;
	getline(cin,str);
	while(getline(cin,str)){
		string nstr;
		int prvIdx=0;
		bool start=false;
		for(int i = 0; i < str.size(); i++){
			if(i==str.size()-1){
				if(!start){
					nstr+=str[i];
				}
				else{
					string ss=str.substr(prvIdx,i-prvIdx+1);
					if(ss=="Hoshino"){
						nstr+="Hoshina";
					}
					else
						nstr+=ss;
				}
				//if(!((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z'))){
				//	nstr+=str[i];
				//}
			}
			else if(((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z'))){
				if(!start){
					start=true;
					prvIdx=i;
				}
			}
			else{
				if(start){
					string ss=str.substr(prvIdx,i-prvIdx);
					if(ss=="Hoshino"){
						nstr+="Hoshina";
					}
					else{
						nstr+=ss;
					}
					start=false;
				}
				nstr+=str[i];
			}

			//if(i==str.size()-1){
			//	string ss=str.substr(prvIdx,str.size()-prvIdx);
			//	if(ss=="Hoshino"){
			//		nstr+="Hoshina";
			//	}
			//	else
			//		nstr+=ss;
			//}
			//else if(!((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z'))){
			//	string ss=str.substr(prvIdx,i-prvIdx);
			//	if(ss=="Hoshino"){
			//		nstr+="Hoshina";
			//	}
			//	else
			//		nstr+=ss;
			//	nstr+=str[i];
			//	prvIdx=i+1;
			//}
		}
		cout<<nstr<<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 << "Hoshina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}	
		 if(j)cout << endl;
	}
	if(j == false)
		cout << endl;  
	return 0;

}

C++: #include <iostream>

int main(){
    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";

    std::cin >> data_set_num;

    while(data_set_num--){
        std::getline(cin,str);
        string::size_type pos = str.find(from);
        while(pos != string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

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

using namespace std;

int main() {
	int b;
	cin >> b;
	string a;
	getline(cin, a);
	for (int i = 0; i < b; i++) {
		getline(cin, a);
		string::size_type index = a.find("Hoshino");
		while (index != string::npos) {
			a.replace(index, 7, "Hoshina");
			index += 7;
			index = a.find("Hoshino", index);
		}
		cout << a << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main()
{
	int n;
	cin>>n;
	cin.ignore();
	while(n--) 
	{
		string in;
		int pos;
		getline(cin,in);
		pos=in.find("Hoshino");
		while(pos!=-1) 
		{
			in[pos]='H'; in[pos+1]='o'; in[pos+2]='s';
			in[pos+3]='h'; in[pos+4]='i'; in[pos+5]='n'; in[pos+6]='a';
			pos=in.find("Hoshino");
		}
		cout<<in<<endl;
	}
  return 0;
}

C++: #include <iostream>
#include <string>
 
int main(void) {
  int n;
  std::string str;
  std::string::size_type id;
   
  std::cin >> n;
  std::cin.ignore();
  for(int i=0; i<n; i++) {
    getline(std::cin, str);
    while((id = str.find("Hoshino")) != std::string::npos) {
        str[id+6] = 'a';
    }
    std::cout << str << std::endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main()
{
	int n;
	cin >> n;
	cin.ignore();
	rep(i,n)
	{
		string s;
		getline(cin,s);

		rep(j,s.length()-6)
		{
			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;
	}
	return 0;
}

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

int main()
{
    int n;
    cin>>n;
    cin.ignore();//?
    while(n--){
        string s;
        getline(cin,s);
        while((s.find("Hoshino")!= -1)){
            s.replace(s.find("Hoshino"),7,"Hoshina");
            //replace(??????,??????????????°,???????????????)
        }
        cout<<s<<endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
 
int main(void){
    int n; //number of data set
 
    std::cin >> n; //input number of data set
    std::cin.ignore(); //delete cin buffer
 
    for(size_t i = 0; i < n; ++i){
        std::vector<std::string> str; //string data
        std::string line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); it.next()){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

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

int main(void)
{
	int N;
	
	while(scanf("%d", &N) != EOF){
		fflush(stdin);
		while(--N, N>=0){
			char instr[1001];
			char *t;
	
			gets(instr);
			while( (t = strstr(instr, "Hoshino")) != NULL){
				t += 6;
				*t = 'a';
			}
	
			printf("%s\n", instr);
		}

	}
	

	return 0;
}

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

int main(){
	int n;
	std::cin >> n;
	std::cin.ignore();
	
	while(n--){
		std::string Eng;
		getline(std::cin, Eng);
		std::string::size_type pos = 0;
		while((pos = Eng.find("Hoshino", pos)) != std::string::npos){
			Eng.replace(pos, 7, "Hoshina");
			pos += 7;
		}
		std::cout << Eng << std::endl;
	}
	
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n;
	std::string buf;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	ifs >> n;
#else
	std::cin >> n;
#endif


#if INPUT_FROM_FILE
	std::getline(ifs, buf);
#else
	std::getline(std::cin, buf);
#endif
	for(int i = 0; i < n; i++){
#if INPUT_FROM_FILE
		std::getline(ifs, buf);
#else
		std::getline(std::cin, buf);
#endif
		int pos = buf.find("Hoshino");
		while(true){
			pos = buf.find("Hoshino", pos);
			if(pos == std::string::npos){ break; }
			buf[pos + 6] = 'a';
			pos += 6;
		}
		std::cout << buf << std::endl;
	}


#if INPUT_FROM_FILE
	//fclose(fp);
#endif
	return 0;
}