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;

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

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

C++: #include <sstream>
#include <iostream>
#include <array>

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence;
    }
}

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

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

int main(){

    int data_set_num = 3;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    getline(std::cin,str);

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::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<vector>

using namespace std;

int main()
{
	int a;
	char str[100];
	char str2[100][100];
	
	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<string>
using namespace std;

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

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

int main(){
	string s;
	int n;
	cin >> n;
	getchar();
	for (int i = 0; i < n; i++){
		getline(cin,s);
		while (1){
			int index = s.find("Hoshino");
			if (index == -1) break;
			s.replace(index,7,"Hoshina");
		}
		cout << s << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

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

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

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

int main(void){

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

    string text,s,ret;
    string str = "Hoshino";
    string astr = "Hoshina";

    for(int i = 0; i < n; ++i) {
        getline(cin, text);
        ret = text;
        for(int j = 0; j < text.size()-6; ++j) {
            s = text.substr(j,str.size());
            if (s.compare(str) == 0) {
                ret = text.replace(j, astr.size(), astr);
                break;
            }

        }

        cout << "ans: " << ret << endl;
    }

}

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

int main(){
	int num;
	std::string english;
	std::cin >> num;

	for(int i=0;i<=num;++i){
		std::getline(std::cin,english);
		while(english.find("Hoshino") != -1){
			int find = english.find("Hoshino");
			english.replace(find, find+7, "Hoshina");
		}

		std::cout << english << std::endl;
	}
    return 0;
}

C++: #include <stdio.h>
int main(){
    int n,now;
    char c;
    bool f;
    while(scanf("%d\n",&n)!=EOF){
        now=0;
        while(now<n){
            scanf("%c",&c);
            f=true;
            while(c=='H'){
                scanf("%c",&c);
                if(c=='o'){
                    scanf("%c",&c);
                    if(c=='s'){
                        scanf("%c",&c);
                        if(c=='h'){
                            scanf("%c",&c);
                            if(c=='i'){
                                scanf("%c",&c);
                                if(c=='n'){
                                    scanf("%c",&c);
                                    if(c=='o'){
                                        printf("Hoshina");
                                        f=false;
                                    }
                                    else printf("Hoshin");
                                }
                                else printf("Hoshi");
                            }
                            else printf("Hosh");
                        }
                        else printf("Hos");
                    }
                    else printf("Ho");
                }
                else printf("H");
            }
            if(f)printf("%c",c);
            if(c=='\n')now++;
        }
    }
}