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>

int main(){
    int n;
    std::string str;
    std::string fr = "Hoshino";
    std::string to = "Hoshina";
    std::string::size_type pos;
    std::cin >> n;
    std::cin.get();
    
  
        //文字列の読み込み
    while(n > 0 && std::getline(std::cin, str)){
        //"Hoshino"を"Hoshina"に変換
        pos = str.find(fr);
        while(pos != std::string::npos){
            str.replace(pos, fr.size(), to);
            pos = str.find(fr, pos+to.size());
        }
        //表示
        std::cout << str << std::endl;
        str = "";
        std::cin.clear();
        --n;
    }
}

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

string replaceAll(string str, string pattern, string replacement) {
  string::size_type pos = str.find(pattern);
  while (pos != string::npos) {
    str.replace(pos, pattern.size(), replacement);
    pos = str.find(pattern, pos + pattern.size());
  }
  return str;
}

void solve() {
  string s;
  while (getline(cin, s)) {
    cout << replaceAll(s, "Hoshino", "Hoshina") << endl;
  }
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	
	int N;

	std::cin >> N;

	for(int i = 0; i < N; ++i){
	
		std::string str;
		std::cin >> str;

		std::string::size_type pos = str.find("Hoshino");
		
		while(pos != std::string::npos){

			 str.replace(pos, find_word.length(), correct_word);

			 pos = str.find(find_word, pos + find_word.length());
		}
	
	std::cout << str << std::endl;
	
	}
	return 0;
}

C++: //#include <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
        int j;
	bool checking  = true;
	for( j = 0; j<=n; j++)
	{
		checking = true;
		char s[MAX_SIZE] = {};
		getline(cin,s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hoshina";
							i+=7;
							check = false;
							checking = check;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			checking = true;
		}	
		 if(j)cout << endl;
		 if(checking == false)
			{
				cout << endl;
				checking = true;
			}
		cout << endl;
	}
	return 0;

}

C++: #include <iostream>
#include <string>u
using namespace std;
int main()
{
	int n; cin >> n ;
	for(int i=0;i<n;i++){
		string str; int cnt=0;
		while(cin>>str)
		{
			string pre_str=str.substr(0,7); 
			if(pre_str=="Hoshino") pre_str="Hoshina";
			if(cnt++) cout << ' ' ;
			cout << pre_str ;
			if(str.size()>7) cout << str.substr(7, str.size()-7) ;
		};
		cout << endl;
	};
}

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

int main(){
  int n;
  char str[1002],cmp[8]="Hoshino";
  scanf("%d%c",&n,&str[0]);
  for(int i=0;i<n;i++){
    gets(str);
    int cnt=0;
    int j=0;
    while(str[j]!='\0'){
      if(str[j]==cmp[cnt])cnt++;
      else cnt=0;
      if(str[j]==cmp[cnt])cnt++;
      if(cnt==7){str[j]='a';cnt=0;}
      j++;
    }
    puts(str);
  }
}

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

using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

typedef long double Real;
#define EPS 1e-13
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

#define MP make_pair<int,int>

int main(){
  int n;
  scanf("%d\n",&n);
  while(n--){
    char __s[2521];
    gets(__s);
    string s(__s);
    int t;
    while((t=s.find("Hoshino"))!=-1){
      s[t+6] = 'a';
    }
    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<iostream>
#include<string>

using namespace std;

int main()
{
   string str;
   int n;

   cin >> n;

   for(int i = 0; i < n; ++i){
      getline( cin, str);

      while( string::npos != str.find( "Hoshino"))
      {
         int pnt = str.find( "Hoshino" );

         str.replace( pnt, 7, "Hoshina");
      }

      cout << str << endl;
   }
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

signed main(void)
{
  int n;
  cin >> n; cin.ignore();
  REP(i, n) {
    string s;
    getline(cin, s);
    FOR(j, 6, s.size()) {
      if(s.substr(j-6, 7) == "Hoshino") s[j] = 'a';
    }
    cout << s << endl;
  }

  return 0;
}