Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	result := make([]string, n, n)

	for i := 0; i < n; i++ {
		scanner.Scan()
		input := scanner.Text()

		result[i] = strings.Replace(input, "Hoshino", "Hoshina", -1)
	}

	for _, v := range result {
		fmt.Println(v)
	}
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int n,i;
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		string str;
		getline(cin,str);
		string::size_type pos;
		for(pos = str.find("Hoshino"); pos != string::npos; pos = str.find("Hoshino",pos+7)){
			str.replace(pos,7,"Hoshina");
		}
		cout<<str<<endl;
	}
	return 0;
}

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <string>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	string words;
	int n;
	int index;
	/*****処理部*****/
	cin >> n;
	for(int i=0;i<n;i++){
		getline(cin,words);
		//cin >> words;
		int j;
		j=0;
		while(1){
			index = words.find("Hoshino",j);
			if(index == string::npos){
				//cout << j << endl;
				break;
			}
			words.replace(index,7,"Hoshina");
			j += 6;
			//cout << words << endl;
		}
		cout << words << endl;
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<string>
 
using namespace std;
 
int main(void){
    std::ios_base::sync_with_stdio(false);
 
    int n,cnt;
    string inp,bun;
 
    cin>>n;
    getchar();
    for(int i=0;i<n;i++){
        bun=("");
        cnt=0;
        while(1){
            inp=getchar();
            if(inp[0]=='\n') break;
            bun+=inp;
            if(cnt>=6){
                if(bun[cnt]=='o'&&bun[cnt-1]=='n'&&bun[cnt-2]=='i'&&bun[cnt-3]=='h'&&bun[cnt-4]=='s'&&bun[cnt-5]=='o'&&bun[cnt-6]=='H') bun[cnt]='a';
            }
            cnt++;
        }
        cout<<bun<<endl;
    }
 
    return 0;
}

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

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

	}
}

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

int main()
{
	int n;
	char str[1001];

	scanf("%d\n", &n);
	for (int i = 0; i < n; i++) {
		fgets(str, 1001, stdin);
		str[strlen(str) - 1] = '\0';

		while (1) {
			if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
			else break;
		}
		puts(str);
	}

	return 0;
}

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

int main() {
  int n;
  cin >> n;
  cin.ignore();
  while(n--) {
    string s, t, u;
    getline(cin, s);
    t = "Hoshino";
    u = "Hoshina";
    for(int i = 0; i < s.size(); ++i) {
      if(s.substr(i, t.size()) == t) {
        cout << u;
        i += t.size() - 1;
      }
    }
    cout << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int main()
{
	int n;
	cin >> n;
	while(getchar()!='\n');
	for(int i=0;i<n;i++)
	{
		char str[1001];
		char *p;
		fgets(str,sizeof(str),stdin);
		while(strstr(str,"Hoshino")!=NULL)
		{
			p=strstr(str,"Hoshino");
			*(p+6) = 'a';
		}
		cout << str;
	}
	return 0;
}

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

int main(void)
{
  int n,s;
  string str;

  cin >> n;

  getline(cin, str);

  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<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main(){
	string f;
	char a[2000];
	int n;
	cin>>n;
	cin.ignore();
	for(int i=0;i<n;i++){
		getline(cin,f);
		for(int j=0;j<f.size();j++)
			a[j]=f[j];
		for(int j=0;j<f.size()-6;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';
		}
		for(int j=0;j<f.size();j++)
			cout<<a[j];
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main(){
int n,len;
string a;
cin>>n;
getline(cin,a);
for(int i=0;i<n;i++){
getline(cin,a);
len=a.size();
for(int o=0;o<=len;o++)
if(a[o]=='H'){
if(a[o+1]=='o')
if(a[o+2]=='s')
if(a[o+3]=='h')
if(a[o+4]=='i')
if(a[o+5]=='n')
if(a[o+6]=='o')
a[o+6]='a';}
cout<<a<<endl;}
return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string str;
	int n;
	cin>>n;
	while(n>=0){
	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';
	n--;
	cout<<str<<endl;
	}
}

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

int main()
{
	int n;

	cin >> n;
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( 1 ){
			index = s.find( "Hoshino", index );
			if( index == string::npos ) break;
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		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++){
		while(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;
               }
            }
            cout<<text;
        }
    }
    return 0;
}

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

int main(){
    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";

    std::cin >> data_set_num;

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

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

using namespace std;

int main(){
	string s;
	int n;
	int c_pos;
	cin>>n;
	cin.ignore();
	while(n--){
		getline(cin,s);
		while((c_pos=s.find("Hoshino"))!=string::npos){
			s.replace(c_pos,7,"Hoshina");
		}
		cout<<s<<endl;
	}
}