Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	result := make([]string, n, n)

	for i := 0; i < n; i++ {
		scanner.Scan()
		input := scanner.Text()

		result[i] = strings.Replace(input, "Hoshino", "Hoshina", -1)
	}

	for _, v := range result {
		fmt.Println(v)
	}
}

C++: #include<stdio.h>
int main(){
    int i,j,n,flag=0,d;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        for(i=0;;i++){
      scanf("%c", &a[i]);
      if(a[i]=='\n'){
    a[i]='\0';
    
    break;
      }
    }

        for(i=0;a[i]!=0;i++){
            //printf("%d ",flag);
            if(flag==0){
                if(a[i]=='H')flag++;
            }
            else if(flag==1){
                if(a[i]=='o')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==2){
                if(a[i]=='s')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==3){
                if(a[i]=='h')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==4){
                if(a[i]=='i')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==5){
                if(a[i]=='n')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==6){
                if(a[i]=='o')a[i]='a';
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
        }
        for(i=0;a[i]!=0;i++)printf("%c",a[i]);puts("");
        for(i=0;a[i]!=0;i++)a[i]=0;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int n;
string s;

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

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>
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 << ret << endl;
    }

}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n;
  cin >> n;
  string gomi;
  getline(cin, gomi);
  rep(i, n) {
    string s;
    getline(cin, s);
    cout << regex_replace(s, regex("Hoshino"), "Hoshina") << endl;
  }
}

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

main(){
	int n ;
	string s ;
	char c[] = {'H','o','s','h','i','n','o'} ;
	
	cin >> n ;
	for( int k=0 ; k<=n ; k++ ){
		getline( cin , s ) ;
		
		for( int i=0 ; i<s.size() ; i++ ){
			int cnt = 0 ;
			if( s[i] == 'H' ){
				for( int j=0 ; j<s.size() && j<7 ; j++ ){
					if( s[i+j] == c[j] ) cnt++ ;
					else break ;
				}
				if( cnt==7 ) s[i+6] = 'a' ;
			}
		}
		
		if( k ) cout << s << endl ;
	}
}

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;

int main(){
	int n;
	scanf("%d ",&n);
	for(int x=0;x<n;++x){
		string line;
		getline(cin,line);
		while (line.find("Hoshino") != string::npos) {
            		line.replace(line.find("Hoshino"), 7, "Hoshina");
       		}	
		cout<<line<<endl;	
	}
	return 0;
}

C++: #include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main(){
    int n;
    string s;
    cin>>n;cin.ignore();

    while(n--){
        getline(cin,s);
        char a[1000];
        strcpy(a,s.c_str());
        int len=strlen(a);
        for(int i=0;i<len-6;i++){
            if(!strncmp(a+i,"Hoshino",7))strncpy(a+i,"Hoshina",7);
        }
        cout<<a<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string s;
	int n;
	cin>>n;
	for(int i=0;i<=n;i++){
		getline(cin,s);
		while(1){
			if(s.find("Hoshina")==string::npos) break;
			s.replace(s.find("Hoshina"),7,"Hashino");
			}
		cout<<s<<endl;
		}
}

C++: #define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <iterator>

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

 
int main(){
	string s;
	while(getline(cin,s)){
		int x;
		while((x = s.find("Hoshino")) != string::npos){
			s[x+6] = 'a';
		}
		cout << s << endl;
	}
    return 0;
}