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<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  string s;
  cin>>n;
  getline(cin,s);
  rep(i,n){
    getline(cin,s);
    for(int j=7;j<=s.size();j++){
      if(s.substr(j-7,7)=="Hoshino")s[j-1]='a';
    }
    cout<<s<<endl;
  }

}

C++: #include <iostream>

using namespace std;

int main(){
  int n;
  cin >> n;
  cin.ignore();

  while(n--){
    string s;
    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(void)
{
  int n,s;
  string str;

  cin >> n;
  
  for(int i = 0 ; i <= n ; i++)
    {
      getline(cin, str);
      s = str.size();
      
      for(int i = 0 ; i < s ; i++)
	{
	  if(str[i] == 'H' && str[i+1] == 'o' && str[i+2] == 's' &&
	     str[i+3] == 'h' && str[i+4] == 'i' && str[i+5] == 'n' &&
	     str[i+6] == 'o')
	    {
	      str[i+6]='a';
	    }
        }
      cout << str << endl;
    }
  return 0;
}

C++: #include<stdio.h>
#include<string.h>
char s[1001];
char w[8];
int main(){
	int n,i,j,k;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf(" %[^\n]s",s);
		for(j=0;j<=strlen(s)-7;j++){
			for(k=0;k<7;k++)w[k]=s[j+k];
			w[7]='\0';
			if(strcmp(w,"Hoshino")==0)s[j+6]='a';
		}
		printf("%s\n",s);
	}
}

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

int main(void)
{
  char x[1010];
  int n;
  int i;
  int a;

  scanf("%d", &n);

  for(i=0; i<n; i++){
    fgets(x, 1010, stdin);

    for(a=0; x[a]!='\n'; a++){
      if(x[a]=='H' && x[a+1]=='o' && x[a+2]=='s' && x[a+3]=='h' && x[a+4]=='i' && x[a+5]=='n' && x[a+6]=='o')
	x[a+6]='a';
    }

    for(a=0; x[i+1]!='\0'; i++){
      printf("%c", x[i]);
    }
    printf("\n");
  }
    return 0;
}

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

int main()
{
  string str;
  int n;
  cin >> n;
  for (int j = 1; j <= n; j++){
    getline(cin, str);
    for (int i = 0; i < str.size(); i++){
      if (str[i] == 'H' && str[i + 1] == 'o' && str[i + 2] == 's' && str[i + 3] == 'h' && str[i + 4] == 'i' && str[i + 5] == 'n' && str[i + 6] == 'o'){
        str[i + 6] = 'a';
      }
    }
    cout << str << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char a[1050]={0};
        fflush(stdin);
        scanf("%[^\n]",a);
        fflush(stdin);
        for(j=0;j<strlen(a);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';
            }
        }
        printf("%s\n",a);
        //for(j = 0; j < 1050; j++)a[j]=0;
        fflush(stdin);

    }
    return 0;
}

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

//ツ閉カツ篠堋療アsツづ景dxツ氾板姪堋つゥツづァ, ツ閉カツ篠堋療アtargetツつェツ出ツ個サツつキツづゥツつゥツづーツ板サツ津ィツつキツづゥ
bool check(string s, string target, int idx){
  for(int i = 0; i < target.size(); i++){
    if(s.length() <= idx + i){
      return false;
    }
    if(s[idx + i] != target[i]){
      return false;
    }
  }

  return true;
}

int main(){
  string s;
  int n;
  cin >> n;

  getline(cin, s); //ツ催?渉可づ個青ョツ青板づーツ偲ヲツづ?つスツつ?づ?づ個嘉シツ行ツつェツ残ツづ?づ?つ「ツづゥツづ個づ? ツ偲ヲツづ?づ?つィツつュ

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

    for(int i = 0; i < s.length(); i++){
      //iツ閉カツ篠堋姪堋つゥツづァ"Hoshino"ツづ可づ按づ?づ?つ「ツづゥツづ按づァ, "Hoshina"ツづ可置ツつォツ環キツつヲ
      if(check(s, "Hoshino", i)){
        s[i + 6] = 'a';
      }
    }

    cout << s << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int ct,len;
	char *rp;
	char retu[1000][1000],s[]="Hoshina";
	scanf("%d",&ct);
	fflush(stdin);
	for(int f1=0;f1<ct;f1++){
		gets(retu[f1]);
	}
	for(int f1=0;f1<ct;f1++){
		if(rp=strstr(retu[f1],"Hoshino")){
			len=strlen(retu[f1]);
			for(int f2=0;f2<7;f2++){
				*rp=s[f2];
				*(rp++);
			}
		}
	}
	for(int f1=0;f1<ct;f1++){
		printf("%s\n",retu[f1]);
	}
	getchar();
	return 0;
}

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

#define BAD "hoshino"

int hoge(void);

int main(){
	int n,i;
	
	cin>>n;
	for(i=0;i<n;i++){
	 hoge();
	}
	
	return 0;
}

int hoge(){
	string text;
	int i;
	
	cin>>text;
	for(i=0;i<text.length()-7;i++){
	 if(text.substr(i,7)==BAD){
	  text[i+6]='a';
	 }
	}
	
	cout<<text<<endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int main(){
	int n;
	cin>>n;
	cin.ignore();

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

		while(str.find("Hoshino") != string::npos)
			str.replace(str.find("Hoshino"), s.size(), s);

		cout<<str<<endl;
		
	}

	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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


int main() {

	int n;
	string sn;
	getline(cin, sn);
	n = atoi(sn.c_str());
	REP(i, n){
		string s;
		getline(cin, s);
		while (s.find("Hoshino") != string::npos){
			s[s.find("Hoshino") + 6] = 'a';
		}
		cout << s << endl;
	}
}

C++: int main(){
	int n;
	std::cin >> n;cin.get( );
	for(int i=0;i<n;i++){
		string s;
		getline(cin, s);
		for(int j=6;j<s.size();j++){
			if(s.substr(j-6,7)=="Hoshino"){
				s.at(j)='a';
			}
		}
		cout << s << endl;
	}
	return 0;
}