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<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;
}

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

int main(){
	int n, p;
	string str;
	
	cin >> n; cin.get();
	while(n--){
		getline(cin, str);
		
		while(p = str.find("Hoshino"), p != string::npos){
			str.replace(p, 7, "Hoshina");
		}
		
		cout << str << endl;
	}
	
	return 0;
}

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

int main(){
	long long int n;
	char* a;
	char letter[1000];
	while(cin >> n){
		for(int i=0 ; i<n ; i++){
			cin >> letter;
		}
		do {
			a=strstr(letter , "Hoshino");
			if (a==NULL) break;
			strncpy(a , "Hoshina" , 7);
			
		} while (a!='\0');
		cout << letter << endl;
	}
	return 0;
}

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

using namespace std;

char str[1001];
char hoshino[] = "Hoshino";
int hlen = strlen(hoshino);

void changeHoshino(int len) {
	for (int i = 0; i <= len - hlen; i++) {
		int j = 0;
		while ((j < hlen) && (str[i+j] == hoshino[j]))
			j++;

		if (j == hlen)
			str[i+j-1] = 'a';
	}
}
int main() {
	int n;

	cin >> n;
	
	fgets(str, 1001, stdin);
	for (int i = 0; i < n; i++) {
		fgets(str, 1001, stdin);

		changeHoshino(strlen(str));

		cout << str;
	}

	return 0;
}

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

using namespace std;

int main(){
	string text;
	int n,j;
	int i;
	
	cin>>n;
	for(j=0;j<n;j++){
	 cin>>text;
	 while(1){
	  i=text.find("Hoshino");
	  if(i!=string::npos){
	   text[i+6]='a';
	  }else{
	   break;
	  }
	 }
	 cout<<text<<endl;
	}
}

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    char _;
    cin >> _;
    for (int i = 0; i < n; ++i) {
        string s;
        getline(cin, s);
        regex re(R"(Hoshino)");
        auto r = regex_replace(s, re, "Hoshina");
        cout << r << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string str;
  
  cin >> n;
  
  for(int i=0;i<=n;i++){
    getline(cin,str);
    
    while(str.find("Hoshino") != string::npos){
      str.replace(str.find("Hoshino"),7,"Hoshina");
    }
    
    if(i!=0) cout << str << endl;
    
  }
  
  return (0);
}

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

int main()
{
  int n;
  
  scanf("%d%*c", &n);
  while (n--){
    string str;
    getline(cin, str);
    while (str.find("Hoshino") != -1){
      str.insert(str.find("Hoshino"), "Hoshina");
      str.erase(str.find("Hoshino"), 7);
    }

    cout << str << '\n';
  }

  return (0);
}