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>

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){
			int find = english.find("Hoshino ");
			english.replace(find, find+7, "Hoshina");
		}
		while(english.find("Hoshino\0") != -1){
			int find = english.find("Hoshino\0");
			english.replace(find, find+7, "Hoshina");
		}
		std::cout << english << std::endl;
	}
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>

int main(){
	char str[1001];
	int n;
	char *c;
	scanf("%d\n", &n);
	for(int i = 0; i < n; i++){
		fgets(str, sizeof(str), stdin); 
		while((c = strstr(str, "Hoshino")) != NULL) c[6] = 'a';
		printf("%s", str);
	}
	return 0;

}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <typeinfo>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;



int main(){
    int n;
    cin>>n;
    getchar();

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

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

using namespace std;

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

	string rect = "Hoshino";

	for (int t = 0; t < n; ++t) {
		char str[2000];
		while (scanf("%s", str) != EOF) {
			for (int i = 0; i < str[i]; ++i) {
				for (int j = 0; j < rect.size() && i < str[i]; ++i, ++j) {
					if (str[i] != rect[j]) break;
					else if (j == rect.size()-1) str[i] = 'a';
				}
			}

			cout << str;

			char c = getchar();
			if (c == '\r' || c == '\n') break;

			cout << " ";
		}
		cout << endl;
	}
}

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';
    d=i;
    break;
      }
    }

        for(i=0;i<d;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;i<d;i++)printf("%c",a[i]);//puts("");
        for(i=0;i<1000;i++)a[i]=0;
    }
    return 0;
}

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

int main() {

  int n; cin >> n;
  {
    char c;
    scanf("%c", &c);
  }

  while (n--) {
    for (int st = 0;;) {
      char c;
      scanf("%c", &c);
      if (c == '\n') break;
      if (st == 0 && c == 'H') st = 1;
      else if (st == 1 && c == 'o') st = 2;
      else if (st == 2 && c == 's') st = 3;
      else if (st == 3 && c == 'h') st = 4;
      else if (st == 4 && c == 'i') st = 5;
      else if (st == 5 && c == 'n') st = 6;
      else if (st == 6 && c == 'o') st = 7;
      else st = 0;

      if (st == 7) {
        st = 0;
        cout << 'a';
      }
      else {
        cout << c;
      }
    }
    cout << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int n, i, j, k, c, x;
	char s[1001], r[1001], t[8] = "Hoshino";
	cin >> n;
	cin.ignore(INT_MAX,'\n');
	for (i = 0; i < n; i++)
	{
		cin.getline(s, sizeof(s));
		c = 0;
		for (j = 0; j < strlen(s); j++)
		{
			r[c] = s[j];
			c++;
			if (s[j] == 'H')
			{
				for (k = j+1, x = 0; k < j+7; k++, c++)
				{
					if (s[k] == t[k-j])
					{
						if (k == j+6)
							r[c] = 'a';
						else
							r[c] = t[k-j];
						x++;
					}
					else
					{
						r[c] = s[k];
						break;
					}
				}
				j+=x;
			}
		}
		r[strlen(s)] = '\0';
		cout << r << endl;
	}
}

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

using namespace std;

string s;

string Replace( string s1, string s2, string s3 )
{
    string :: size_type  pos( s1.find( s2 ) );
    while( pos != string :: npos )
    {
        s1.replace( pos, s2.size(), s3 );
        pos = s1.find( s2, pos + s3.size() );
    }
    return s1;
}

signed main()
{
    int n = 0;
    scanf( "%d\n", &n );
    while( 0 < n )
    {
        getline( cin, s );
        s = Replace( s, "Hoshino", "Hoshina" );
        cout << s << endl;
        n--;
    }
    return 0;
}

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

int main()
{
  string str;
  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 + 5] == 'o'){
      str[i + 5] = 'a';
    }
  }
  cout << str << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
  int n;
  cin>>n;
  string line;
  string s = "Hoshina";
  //cin.ignore();
  while(getline(cin >> ws, line)){
    while(line.find("Hoshino")!=string::npos){
      line.replace(line.find("Hoshino"), s.size(), s);
    }
    cout<<line<<endl;
  }
  return 0;
}

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

int main(){
	int dataN,i,j,tmp;
	string str;
	
	cin>>dataN;
	for(j=0;j<dataN;j++){
	 cin>>str;
	 while(1){
	  tmp=str.find("Hoshino");
	  if(tmp==-1){break;}
	  str[tmp+6]='a';
	 }
	 cout<<str;
	}
	
	return 0;
}