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 <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

int main() {
  int n;
  string s;

  cin >> n;
  getline(cin, s);
  REP(i, n) {
    getline(cin, s);
    while(1) {
      string::size_type index = s.find("Hoshino");
      if(index == string::npos) break;
      else s.replace(index, 7, "Hoshina");
    }
    cout << s << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  cin>>n;
  cin.ignore();
  rep(i,n){
    string s;
    getline(cin,s);
    string ans="";
    rep(j,s.size()){
      if(j+6<s.size() && s.substr(j,7)=="Hoshino")
        ans+="Hoshina",j+=6;
      else
        ans+=s[j];
    }
    cout<<ans<<endl;
  }
}

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

int main(void)
{
	int n, i;
	char a[1000][1000] = {0};
	char *p;

	scanf("%d\n", &n);
	
	for (i = 0; i < n; i++)
		gets(a[i]);

	for (i = 0; i < n; i++)
	{
		p = strstr(a[i], "Hoshino");
		if (p != NULL)
			p[6] = 'a';
	}

	for (i = 0; i < n; i++)
		puts(a[i]);

	return 0;
}

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

int main()
{
    string str[1099];
    string s;
    int test,k;
    char ch;

    cin>>test;
    cin.ignore();

    while(test--)
    {
        k=0;
        while(cin>>s)
        {
            if(s==" ")
                continue;

            str[k]=s;
            ch=getchar();
            if(ch=='\n')
                break;
            k++;
        }

        for(int i=0; i<=k; i++)
        {
            if(str[i]=="Hoshino")
                str[i]="Hoshina";
        }

        for(int i=0;i<=k;i++)
            cout<<str[i]<<" ";
        cout<<endl;

       // memset(str,'\0',sizeof(str));

       for(int i=0;i<=k;i++)
        str[i]="";
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

//?????????s???????????????f?????¨???t??????????????? 
string replaceAll(string s, string f, string t) {
	string::size_type pos = s.find(f);
	while (pos != string::npos) {
		s.replace(pos, f.size(), t);
		pos = s.find(f, pos + t.size());
	}
	return s;
}

signed main() {
	int n; cin >> n; cin.ignore();
	rep(i, 0, n) {
		string s; getline(cin, s);
		cout << replaceAll(s, "Hoshino", "Hoshina") << endl;
	}
	return 0;
}

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

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;
	for(j=0;j<n;j++){
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c==endl){
	   break;
	  }else{
	   switch(flg){
		case 0:
		if(c=='H'){flg++;}
		break;
		case 1:
		if(c=='o'){flg++;}else{flg=0;}
		break;
		case 2:
		if(c=='s'){flg++;}else{flg=0;}
		break;
		case 3:
		if(c=='h'){flg++;}else{flg=0;}
		break;
		case 4:
		if(c=='i'){flg++;}else{flg=0;}
		break;
		case 5:
		if(c=='n'){flg++;}else{flg=0;}
		break;
		case 6:
		if(c=='o'){c='a';}
		flg=0;
		break;
	   }
	   cout<<c;
	  }
	 }
	 cout<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
    int i,j,n,flag=0;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        scanf("%c",&a[0]);
        for(i=1;;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 <string>
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	cin.ignore();
	while (n--) {
		string line,word;
		getline(cin,line);
		string::size_type hoshino_pos;
		while ((hoshino_pos = line.find("Hoshino")) != string::npos) {
			line.replace(hoshino_pos + 6,1,"a");
		}
		cout << line << endl;
	}
}