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>
#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;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
char text[1001];
int main(){
    int i,ii,j,n,a;
    cin>>n;   
    for(i=0;i<=n;i++){
        gets(text);
		a=strlen(text);
		for(j=0;j<a-6;j++){
              if(text[j]=='H'&&text[j+1]=='o'&&text[j+2]=='s'&&text[j+3]=='h'&&text[j+4]=='i'&&text[j+5]=='n'&&text[j+6]=='o'){
                   text[j+6]='a';j+=6;
               }
            }
			if(i==0)continue;
            cout<<text<<endl;
    }

    return 0;
}

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

using namespace std;

int main()
{
    string S, P; int N;
    
    getline(cin, P);
    
    N = stoi(P);
    
    for(int i = 0; i < N; i++)
    {
        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>
using namespace std;

int main(){
	string x;
	int i=0,n;
	cin >> n;
	for (i = 0; i < n;i++){
		x = "";
		cin >> x;cin.ignore();
	
		string::size_type pos;
		while ((pos=x.find("Hoshino"))!= string::npos){
			x.replace(pos, 7, "Hoshina");
		}
		cout << x << endl;

	}
	return 0;
}