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>

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;
  getline(cin, str);

  for(int i=0;i<line_length;++i){
    string input;
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  string str;
  int n;
  cin >> n;
  cin.ignore();
  while(n--){
  getline(cin,str);

    for(int pos = str.find("Hoshino") ; pos != string::npos ;
	pos = str.find("Hoshino",7 + pos ))
      {
	str.replace(pos,7,"Hoshina");
      }
    cout << str << endl;
  }
  return 0;
}

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

int main()
{
	int n;
	char str[1024];

	cin >> n;

	for (int i = 0; i < n; i++){
		fgets(str, sizeof(str), stdin);

		int len = strlen(str);
		for (int j = 0; j < len - 5; j++){
			if (strncmp(&str[j], "Hoshino", 7) == 0){
				str[j + 6] = 'a';
			}
		}

		cout << str << endl;
}

	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 = "Hoshino";
	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-1] = 'a';
			--i;
		}
		++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>
using namespace std;
int main(){
long n,i;
string s;
string::size_type p;
cin>>n;
getline(cin,s);
for(i=0;i<n;i++){
getline(cin,s);
p=-1;
for(;;){
p=s.find("Hoshino",p+1);
if(p==string::npos)break;
s.replace(p,7,"Hoshina");
}
cout<<s<<endl;
}
return 0;
}

C++: #include <iostream>
#include <string>
   
int main(){
    const std::string wrong_word("Hoshino");
    const std::string right_word("Hoshina");
     
    int num;
    std::cin >> num;
    std::cin.ignore(); // ignore next newline character
       
    for(int i = 0; i < num; ++i){
        std::string str;
        std::getline(std::cin, str);
         
        std::size_t pos = str.find(wrong_word);
        while(pos != std::string::npos){
            str.replace(pos, wrong_word.length(), right_word);
            pos = str.find(wrong_word);
        }
         
        std::cout << str << std::endl;
    }
    return 0;

C++: #include <stdio.h>
#include <string.h>

int main(void)
{
  char x[1010];
  int n;
  int i;
  int a;

  scanf("%d", &n);

  for(i=0; i<n; i++){
    fgets(x, 1010, stdin);

    for(a=0; x[a]!='\n'; a++){
      if(x[a]=='H' && x[a+1]=='o' && x[a+2]=='s' && x[a+3]=='h' && x[a+4]=='i' && x[a+5]=='n' && x[a+6]=='o')
	x[a+6]='a';
    }

    printf("%s", x);
  }
    return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include<math.h>

int main(void){

	int i,j,n;
	char a[1000];
	scanf("%d",&n);
	for(i = 0;i < n;i++){
        fgets(a,sizeof(a),stdin);
        if(a[i]=='h'&&a[i+1]=='o'&&a[i+2]=='s'&&a[i+3]=='h'&&a[i+4]=='i'&&a[i+5]=='n'&&a[i+6]=='o'){
                a[i+6]='a';
                printf("%s\n",&a[i]);
        }
    }


return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <bitset>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define Sort(x) sort((x).begin(),(x).end())
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000009
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef std::pair<int,int> pii;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;


int main(){
    string s;
    int n;cin>>n;
    getline(cin,s);
    rep(i,0,n){
        getline(cin,s);
        if(s=="Hoshino"){
            cout<<"Hoshina"<<endl;
            continue;
        }
        string ss;
        bool start=true;
        rep(i,0,s.length()){
            if(s[i]==' '){
                if(!start)cout<<" ";
                if(start)start=false;
                if(ss=="Hoshino"){
                    cout<<"Hoshina";
                }else{
                    cout<<ss;
                }
                ss.clear();
            }else {
                ss.pb(s[i]);
            }
        }
        if(!start)cout<<" ";
        cout<<ss;
        cout<<endl;
    }

    
    return 0;
}

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

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

	std::cin >> num;

	getline(std::cin, str); // skip "\n"

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

		std::getline(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+7);
			}

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

		}

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

		start = 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) == 'a')
						{
							cout << "Hoshino";
							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 <array>

int main(){
  std::array<int, 4> a = {};
  std::array<int, 4> b = {};
  int hit = 0;
  int blow = 0;
  int N = 0;

  while(N <= 50 && std::cin >> a[0] >> a[1] >> a[2] >> a[3] && std::cin >> b[0] >> b[1] >> b[2] >> b[3]){
    

    for(int i = 0;i < 4;++i){
      for(int j = 0;j < 4;++j){
	if(a[i] == b[j] && i == j)
	  ++hit;
	if(a[i] == b[j] && i != j)
	  ++blow;
      }
    }
    std::cout << hit << " " << blow << std::endl;

    hit = 0;
    blow = 0;
    ++N;
  }
}

C++: #include<iostream>
using namespace std;
 
int main(){
	int n;
	 
  	cin>>n;
  	string A;
  	getline(cin, A);
  	while(n--) {
  		
    getline(cin, A);
    for(int i=0;i<A.length()-6;i++) {
    	
    if(A.substr(i,7) == "Hoshino")
    A.replace(i, 7, "Hoshina");

    }
    cout<<A<<endl;
  }
  	return 0;
}

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

typedef string::iterator S;
string HOSHINO("Hoshino");
int lh = HOSHINO.size();
string HOSHINA("Hoshina");
string trg;

string hoshina(string& trg){
    if( trg.size() < lh ) return trg;
    for(S it = trg.begin(); it+lh-1!=trg.end(); it++){
        string cp(it, it+lh);
        if( cp == HOSHINO ) trg.replace(it,it+lh,HOSHINA);
    }
    return trg;
}

int main(){
    int n;
    cin >> n;
    getline(cin, trg);
    while(n--){
        getline(cin, trg);
        cout << hoshina(trg) << endl;
    }
    return 0;
}