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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
int n;
using namespace std;
bool is_change(string& str,int pos, int len){
	const char A[] = {'H','o','s','h','i','n','a'};
	if(str.substr(pos,len) == "Hoshino"){
		for(int i=pos,j=0;i<pos+len,j<7;i++,j++){
			str[i] = A[j];
		}
		return true;
	}

	return false;
}
int main(){
	std::ios::sync_with_stdio(false);
	cin>>n;
	for(int i=0;i<n;i++){
		string str;
		for(int i=0;i+6<str.size();i++){
			if(is_change(str,i,7)){
				i+=6;
			}
		}
		cout<<str<<"\n";
	}
	return 0;
}

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

int main(){
	int n; // the number of datasets
	std::cin >> n;
	std::cin.ignore();

	for(int i = 0; i < n; ++i){
		std::string text;
		std::getline(std::cin, text); // input
		
		int text_size = text.size();
		int moji = 0;
		while(moji < text_size){
			moji = text.find("Hoshino", moji);
			text.replace(moji, 7, "Hoshina");
		}
		
		std::cout << text << std::endl; //output
	}

	return 0;
}

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

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.length()-6; ++j) {
            s = text.substr(j,str.length());
            if (s.compare(str) == 0) {
                ret = text.replace(j, astr.length(), astr);
                break;
            }

        }

        cout << "ans: " << ret << 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.length()-6; ++j) {
            s = text.substr(j,str.length());
            if (s.compare(str) == 0) {
                ret = text.replace(j, astr.length(), astr);
                break;
            }

        }

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

}

C++: #include <stdio.h>
int main(){
    int n,now;
    char a[1000],c;
    while(scanf("%d\n",&n)!=EOF){
        now=0;
        while(now<n){
        if(a[0]=='H'&&a[1]=='o'&&a[2]=='s'&&a[3]=='h'&&a[4]=='i'&&a[5]=='n'&&a[6]=='o'&&a[7]=='\0')printf("Hoshina");
        else printf("%s",a);
        scanf("%c",&c);
        printf("%c",c);
            if(c=='\n')now++;
        a[7]='\0';
    }
    }
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
    string str, judge = "";
    bool bo=false;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        if (i == 0) { getline(cin, str); }
        getline(cin, str);
        for (int j = 0; j < str.size(); j++) {
            if(str[j]=='H'||bo==true){
            judge += str[j];
                bo=true;
            }
            else{
                cout<<str[j];
            }
            if (judge == "Hoshino") {
                cout << "Hoshina";
                judge = "";
                bo=false;
            }
            else if(judge.size()==7 && judge!="Hoshino"){
                cout<<judge;
                judge="";
                bo=false;
            }
        }
        cout << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  getline(cin,s);
  rep(i,n){
    getline(cin,s);
    while(s.find("Hoshino") != string::npos){
      s.replace(s.find("Hoshino"),7,"Hoshina");
    }
    cout << s << endl;
  }
  return 0;
}

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){
			size_t find = english.find("Hoshino");
			english.replace(find, find+7, "Hoshina");
		}

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

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

int main(void){

	int i,j,n;
	char *p;
	char a[1000];
	scanf("%d\n",&n);
	for(i = 0;i < n;i++){
        fgets(a,sizeof(a),stdin);
        while((p = strstr(a,"hoshino"))!=NULL){
            p[6] = 'a';
        }
                printf("%s",a);

    }


return 0;
}