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 <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(i=a; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++)

/*
  AOJ :: 0101
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0101&lang=jp
 */


int main(){
    int n,i;
    string in;

    cin >> n; cin.ignore();
    rep(i,n){
        getline(cin, in);
        while( true ){
            int p = in.find("Hoshino");
            if( p == string::npos ) break;
            in[p+6] = 'a';
        }
        cout << in << endl;
    }

    return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int ct;
	char* rp;
	char retu[1000];
	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",retu);
	}
	return 0;
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;cin.ignore(2);

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

using namespace std;

int main()
{
	int a;
	char str[100];
	char str2[100][1000];
	
	cin >> a;
	
	for(int i = 0; i < a; i++){
		fgets(str2[i],1000,stdin);
	//	scanf("%s",str2[i]);
	}
	
	for(int i = 0; i < a; i++){
		for(int j = 0; str2[i][j] != '\n'; j++){
			if(str2[i][j] == 'H' && str2[i][j+1] == 'o' && str2[i][j+2] == 's' && str2[i][j+3] == 'h' && str2[i][j+4] == 'i' && str2[i][j+5] == 'n' && str2[i][j+6] == 'o'){
				str2[i][j+6] = 'a';
			}
		}
	}
	
	for(int i = 0; i < a; i++){
		printf("%s",str2[i]);
	}
}

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

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

    //std::vector<string> *str = new std::vector<string>[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;
        std::string buf;
        getline(std::cin, tmp);
        std::stringstream ss(tmp);
        //sprit
        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.clear();
    	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 <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	int n;
	cin >> n;
	string s;
	string sub;
	for (int i = 0; i < n; ++i) {
		cin >> s;
		for (int j = 0; j < s.size(); ++j) {
			if (s.size() < 7) {
				break;
			}
			sub = s.substr(j, 7);
			if (sub == "Hoshino") {
				s.replace(j, 7, "Hoshina");
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

using namespace std;

int main(void)
{
	int N;
	

	scanf("%d", &N);
	cin.get();
	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() {
    std::string src = "Hoshino";
    std::string tar = "Hoshina";

    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

    int n;
    std::cin >> n;
    std::cin.ignore();

    std::string s;
    for (int i = 0; i < n; i++) {
        std::getline(std::cin, s);
        auto pos = s.find(src);
        while (pos != std::string::npos) {
            s.replace(pos, tar.length(), tar);
            pos = s.find(src, pos + tar.length());
        }

        std::cout << s << std::endl;
    }
}

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

int main()
{
    int n;
    cin >> n;cin.get( );
    //n++;
    string ss;
    for(int j=0;j<n;j++)
    {
        getline(cin,ss);
        int len =ss.size();
        for(int i=6;i<len;i++)
        {
            //cout << ss[i];
            if(ss.substr(i-6,7)=="Hoshino")
            {
                ss[i]='a';
            }
            //if(ss[i]=='\0')break;
        }

        /*for(int i=0;i<len;i++){
            if(ss[i]=='\0')break;
            cout <<ss[i];
        }*/
        cout <<ss << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main(){
int n,len;
string a;
cin>>n;
getline(cin,a);
for(int i=0;i<n;i++){
getline(cin,a);
len=a.size();
if(a[i]=='H'){
if(a[i+1]=='o')
if(a[i+2]=='s')
if(a[i+3]=='h')
if(a[i+4]=='i')
if(a[i+5]=='n')
if(a[i+6]=='o')
a[i+6]='a';}
cout<<a<<endl;}
return 0;
}

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

int main(){
  int n;//回数
  cin >> n;
  cin.get();
  for(int i=0;i<n;i++){
  string s;
  getline(cin,s);//１行読み込む
  for(int i=0;i<s.size();i++){
    if(s.substr(i,7)=="Hoshino")
      s[i+6]='a';
  }
  cout << s << endl;
  }
}

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

int main()
{
	int n;
	cin>>n;
	cin.get();
	for(int i=0;i<n;i++){
		string s;
		getline(cin,s);
		for(int j=0;j<=s.size()-7;j++){
			if(s.substr(j,7)=="Hoshino")
				s[j+6]='a';
		}
		cout<<s<<endl;
	}
	return 0;

}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <bitset>
#include <complex>
using namespace std;
 
const double EPS = 1e-9;
const double PI = 3.14159265359;
 
typedef complex<double> P;

typedef long long int li;

int main(){
	int n;
	string hos = "Hoshino";

	cin >> n;
	cin.ignore();
	while(n--){
		string s;
		getline(cin, s);

		int k = s.size()+1-hos.size();
		for(int i = 0; i < k; i++){
			if(s.substr(i, hos.size()) == hos){
				s[i+hos.size()-1] = 'a';
			}
		}

		cout << s << endl;
	}

    return 0;
}

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

using namespace std;

int main()
{
	int tc;
	char str[1011];
	
	cin >> tc;
	while(tc--) {
		scanf(" %[^\n]", str);
		string s(str);
		int len = s.size();
		for(int i = 0; i < len; i++) {
			int pos = s.find("Hoshino");
			int lastPos = s.find(pos+2, 'o');
			if(pos != -1 && lastPos != len - 1)
				s.replace(pos, 7, "Hoshina");
			else if(pos != -1)
				s.replace(pos, 6, "Hoshina");
		}
		cout << s <<endl;
	}

	return 0;
}