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)
{
	string str;
	string::size_type index;
	int num;
	int number;
	int i,j;

	cin >> num;
	getline(cin,str);//ツ催渉可づ個づ「ツづつつセツつッツ禿づ敖債楪づ慊つケ
	for(i=0;i<num;i++)
	{
		getline(cin,str);
		number = 0;
		while((index = str.find("Hoshino") ) != string::npos)
		{
			str.replace(index,7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	int n;
	scanf("%d\n", &n);
	string name = "Hoshino";
	while(n--)
	{
		string s;
		getline(cin, s);
		for(int i = 0; i < s.length() - name.length() + 1; ++i)
		{
			bool flag = true;
			for(int j = 0; j < name.length(); ++j)
			{
				if(s[i + j] != name[j])
				{
					flag = false;
					break;
				}
			}
			if(flag)
			{
				s[i + name.length() - 1] = 'a';
			}
			else
			{
				continue;
			}
		}
		cout << s << endl;
	}
}

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

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

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::string text;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        getline(std::cin, text);
        u_int index =  0;
        
        while((index = text.find(str_false, index)) != std::string::npos)
            text.replace(index, str_false.size(), str_true);
        std::cout  << text << std::endl;
    }
    
    return 0;
}

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

#define N 1000

using namespace std;

int main()
{
	int n;
	int s;
	string str;

	cin >> n;
	cin.ignore();

	for(int i = 0; i < n; i++)
	{
		getline(cin,str);

		for(s = 0; s < N; s++){

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

		}
		cout << str << endl;

	}
}

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

int main(){
    int dataSetNum;
    std::cin >> dataSetNum;

    std::vector< std::vector<std::string> > str;
    str.resize(dataSetNum);
    std::cin.ignore();

    //input & sprit
    for(int i = 0; i < dataSetNum; ++i){
        //input
        std::string tmp;
        getline(std::cin, tmp);
        std::stringstream ss(tmp);

        //sprit
        std::string buf;
        while( getline(ss, buf, ' ') ){
            str[i].push_back(buf);
        }
    }

    //replace
    for(int i = 0; i < dataSetNum; ++i){
        std::replace_if(str[i].begin(), str[i].end(),
    [](std::string x) { return x == "Hoshino"; }, "Hoshina");
    }
    
    //output
    for(int i = 0; i < dataSetNum; ++i){
    	std::string tmp;
    	tmp = str[i].front();
    	std::for_each(str[i].begin() + 1, str[i].end(),
    [&tmp](std::string x) { tmp += ' ' + x; } );
    	std::cout << tmp << std::endl;
    }

    return 0;
}

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()-6){
        int b=(int)s.find("Hoshino",i);
            if(b!=-1){s.replace(b+i,7,"Hoshina");i+=7;}
    }
        cout<<s<<endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <utility>
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int n;
	cin>>n;cin.ignore();
	while(n--)
	{
		string a;
		getline(cin,a);
		for(int i=a.find("Hoshino");i!=string::npos;i=a.find("Hoshino"))
			a[i+6]='a';
		cout<<a<<endl;
	}
}

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

using namespace std;

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

}

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

int main(){
  int n;
  char c;
  int f;

  cin >> n;
  getchar();

  f = 0;
  while(n){
    c = getchar();

    if(f == 0 && c == 'H')f++;
    else if(f == 1){
      if(c == 'o')f++;
      else f = -1;
    }else if(f == 2){
      if(c == 's')f++;
      else f = -1;
    }else if(f == 3){
      if(c == 'h')f++;
      else f = -1;
    }else if(f == 4){
      if(c == 'i')f++;
      else f = -1;
    }else if(f == 5){
      if(c == 'n')f++;
      else f = -1;
    }else if(f == 6){
      if(c == 'o')c = 'a';
      f = -1;
    }

    if(c == '\n'){
      n--;
      f = 0;
    }else if(c == ' ')f = 0;

    putchar(c);
  }
}

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

int main()
{
	char in[1001];
	int n;
	char hoshina[] = {"Hoshina"};
	string words;
	string::size_type hed;

	cin >> n;
	fflush(stdin);

	for(int i = 0; i < n; i++){
		gets(in);
		words = in;
		while(words.find("Hoshino ") != string::npos){
			hed = words.find("Hoshino ");
			for(int j = 0; j < 7; j++){
				words[hed] = hoshina[j];
				hed++;
			}
		}
		if(words.find("Hoshino\0") != string::npos){
			hed = words.find("Hoshino\0");
			for(int j = 0; j < 7; j++){
				words[hed] = hoshina[j];
				hed++;
			}
		}
		cout << words << endl;
	}

	return 0;
}

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

#define BAD "hoshino"

int hoge(void);

int main(){
	int n,i;
	
	cin>>n;
	for(i=0;i<n;i++){
	 hoge();
	}
	
	return 0;
}

int hoge(){
	string text;
	int i;
	
	cin>>text;
	for(i=0;i<text.length();i++){
	 if(text.substr(i,7)==BAD){
	  text[i+6]='a';
	 }
	}
	
	cout<<text<<endl;
	return 0;
}

C++: #include<iostream>
int main(){
	int a;
	std::cin>>a;
	for(int i=0;i<a;i++){
		std::string str;
		std::cin>>str;
		for(int j=0;j<str.size();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';
			}
		}
		std::cout<<str<<std::endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
string S;
int main() {
	while (getline(cin, S)) {
		for (int i = 0; i < S.size() - 6; i++) {
			if (S.substr(i, 7) == "Hoshino") {
				S[i + 6] = 'a';
			}
		}
		cout << S << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a;
    string str,Hoshino="Hoshino";
    cin>>n;
    getline(cin,str);
    for(int i=0;i<n;i++){
        getline(cin,str);
        for(int j=0;str[j]!='\0';j++){
            if(str[j]=='H'){
                for(int k=j;k<7+j;k++){
                    if(str[k]!=Hoshino[k-j])break;
                    if(k==j+6)str[k]='a';
                }
            }
        }
        cout<<str<<endl;
    }
}