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>
using namespace std;

#define BAD "hoshino"

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();i++){
	 if(text.substr(i,BAD.length())==BAD){
	  text[i+BAD.length()-1]='a';
	 }
	}
	
	cout<<text<<endl;
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin >>n;
  cin.ignore();
  while(n--){
    string s;
    getline(cin,s);
    for(;;){
      string::size_type x = s.find("Hoshino");
      if(x == string::npos){break;}
      s[x+6] = 'a';
    }
    cout <<s<<endl;
  }
  return 0;
}

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

using std::string;

int main () {
  int n;
  string str;

  std::cin >> n;
  std::cin.ignore();
  
  for (int i = 0; i < n; i++) { 
    std::getline(std::cin, str);

    size_t pos;
    while ((pos = str.find("Hoshino")) != string::npos) {
      str[pos+6] = 'a';
    }
    
    std::cout << str << std::endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

string s;

int main(){
	getline(cin,s);
	while(getline(cin,s)){
		int a=s.find("Hoshino");
		while(a!=string::npos){
			s=s.substr(0,a)+"Hoshina"+s.substr(a+7);
			a=s.find("Hoshino");
		}
		cout<<s<<endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <bitset>
#include <complex>
using namespace std;
 
const double EPS = 1e-9;
const double PI = 3.14159265359;
 
typedef complex<double> P;

typedef long long int li;

int main(){
	int n;
	string hos = "Hoshino";

	cin >> n;
	cin.ignore();
	while(n--){
		string s;
		getline(cin, s);

		for(int i = 0; i < s.size()+1-hos.size(); i++){
			if(s.substr(i, hos.size()) == hos){
				s[i+hos.size()-1] = 'a';
			}
		}

		cout << s << endl;
	}

    return 0;
}

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

C++: #include <bits/stdc++.h>
using namespace std;main(){int N;string S,T="Hoshino";cin>>N;for(int i=0;i<N;i++){getline(cin,S);while(S.find(T)!=-1){S.replace(S.find(T),S.find(T)+7,"Hoshina");}cout<<S<<"\n";}}

C++: #include<iostream>
using namespace std;
void replaceAll(string& str, const string&pat, const string& rep) {
  string::size_type p = str.find(pat);
  while(p != string::npos) {
    str.replace(p, pat.length(), rep);
    p = str.find(pat, p + rep.length());
  }
}
int main(int argc, char *argv[])
{
  int n;
  cin >> n;
  { string str; getline(cin, str); }
  while(n--) {
    string str;
    getline(cin, str);
    replaceAll(str, "Hoshino", "Hoshina");
    cout << str << endl;
  }
  return 0;
}

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

int main(void){

	int i,j,n;
	char *p;
	char a[1000];
	scanf("%d\n",&n);
	for(i = 0;i < n;i++){
        fgets(a,sizeof(a),stdin);
        while((p = strstr(a,"hoshino"))!=NULL){
            p[6] = 'a';
        }
                printf("%s\n",a);

    }


return 0;
}

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

int main(void)
{
	int n;
	char str[10000],c;
	char *t;

	scanf("%d\n", &n);

	for(int i = 0; i < n; i++){
		gets(str);

		while(t=strstr(str, "Hoshino"),t){
			t[6]  = 'a';
		}
		printf("%s\n", str);
	}
	return 0;
}

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

int main()
{
	string n;
	getline(cin, n);
	string s;
	while (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 <string>

using namespace std;

int main()
{
	int n;
	string str;
	char tmp[1010];
	cin >> n;
	cin.ignore();
	while (n > 0){
		cin.getline(tmp, sizeof(tmp));
		str = tmp;
		int len = 1;
		while (1){
			len = str.find("Hoshino", len - 1);
			if (len == -1)  break;
			str[len + 6] = 'a';
		}
		cout << str << endl;
		n--;
	}
	return (0);
}

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

using namespace std;

int main(){
	string s;
	int n;
	cin>>n;
	while(--n){getline(cin,s);
		for(int i=0;i<s.size()-5;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+1]='a';s[i+6]='o';
			}
		}
		
		cout<<s<<endl;
		
	}

}

C++: #include <sstream>
#include <iostream>
#include <array>

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

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

int main(){
	int num;
	std::string english,dammy;
	std::cin >> num;
	std::getline(std::cin,dammy);
	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 <cstdio>
#include <cstring>
using namespace std;

int main() {
	int n;

	cin >> n;

	for (int i = 0; i < n; i++) {
		char str[1001];
		gets(str);
		for (int j = 0, len = strlen(str); j < len - 6; j++) {
			if (strcmp(&str[j], "Hoshino") == 0) {
				strncpy(&str[j], "Hoshina", strlen("Hoshina"));
			}
			cout << str << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(){
  int n;
  scanf("%d\n", &n);
  int i;
  for(i=0;i<n;i++){
    char str[1000];
    gets(str);
    string s(str);
    int index=0;
    while((index=s.find("Hoshino", index)) != string::npos)
      s.replace(index, 7, "Hoshina");

    printf("%s\n", (s.c_str()));
  }
}

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

string replaceAAAtoBBB(const string& str) {
  string str2(str);
  string before = "Hoshino";
  string after = "Hoshina";
  int idx = 0;

  while( (idx = str2.find(before, idx)) >= 0) {
	str2.replace(idx, before.length(), after);
  }
  return str2;
}

int main() {
  int n;
  string buf;

  cin >> n;
  cin.ignore();
  
  for(int i = 0; i < n; ++i) {
	getline(cin, buf);
	cout << replaceAAAtoBBB(buf) << endl;
  }

  return 0;
}