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;

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

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

int main(){
    std::string buf;
    int n;

    std::cin >> n;
    // now, there is "\n ...." in the stream.
    // then, skip the initial '\n'.
    std::getline(std::cin,buf);

    for (int i=0;i < n;++i) {
        std::getline(std::cin,buf);
        std::stringstream ss(buf);

        // replace the first word in the text.
        ss >> buf;
            if (buf == "Hoshino") {
                std::cout << "Hoshina";
            }
            else if (buf == "Hoshino,") {
                std::cout << "Hoshina,";
            }
            else if (buf == "Hoshino.") {
                std::cout << "Hoshina.";
            }
            else if (buf == "Hoshino's") {
                           std::cout << "Hoshina's";
                       }
            else if (buf == "\"Hoshino") {
                std::cout << "\"Hoshina";
            }
            else{
                std::cout << buf;
            }

       // replace the follow-on words with' '.
        while (ss >> buf) {
            if (buf == "Hoshino") {
                std::cout << " Hoshina";
            }
            else if (buf == "Hoshino,") {
                std::cout << " Hoshina,";
            }
            else if (buf == "Hoshino.") {
                std::cout << " Hoshina.";
            }
            else if (buf == "Hoshino's") {
                std::cout << " Hoshina's";
            }
            else if (buf == "\"Hoshino") {
                std::cout << " \"Hoshina";
            }
            else{
                std::cout << " " << buf;
            }
        }
        std::cout << std::endl;
    }

    return 0;
}

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

int main(void) {
  int n;
  string str;
  
  cin >> n;
  cin.ignore();
  for(int j=0; j<n; j++) {
    getline(cin, str);
    for(int i=0; i<str.length()-6; i++) {
      if(str.substr(i, 7) == "Hoshino") { str[i+6] = 'a'; i+=7; }
    }
    cout << str << endl;
  }
  
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<sstream>
#include<map>
#include<algorithm>
using namespace std;

string change(string,int);

int main(){
   int n,i;
   int pl;
   string str,z;
   string::size_type ind;
   
   cin>>n;
   getline(cin,z);
   for(i=0;i<n;i++){
      getline(cin,str);
      
      ind=str.find("Hoshino");
      while(ind!=string::npos){
         pl = (int)str.find("Hoshino");
         str = change(str,pl);
         ind = str.find("Hoshino");
      }
      cout<<str<<endl;
   }
   return 0;
}

string change(string str,int pl){
   int i,l=0;
   string name = "Hoshina";
   
   for(i=pl;i<pl+7;i++){
      str[i]=name[l];
      l++;
   }
   return str;
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	
	int N;

	std::cin >> N;

	for(int i = 0; i <= N; ++i){
	
		std::string str;
		std::getline(std::cin,str);

		std::string::size_type pos = str.find(find_word);
		
		while(pos != std::string::npos){

			 str.replace(pos, find_word.length(), correct_word);

			 pos = str.find(find_word, pos + find_word.length());
		}
	
		std::cout << str << std::endl;
	
	}
	return 0;
}

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

int main(){
	int data_set;
	std::cin >> data_set;
	std::cin.get();
	std::string document[data_set];
	for(int i = 0; i < data_set; ++i){
		std::getline(std::cin, document[i]);
	}
	for(int i = 0; i < data_set; ++i){
		auto pos = document[i].find("Hoshino");
		while(pos != std::string::npos){
			document[i].replace(pos, 7, "Hoshina");
			pos = document[i].find("Hoshino", pos + 7);
		}
		std::cout << document[i] << std::endl;
	}
	return 0;
}

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

#define N 1000

using namespace std;

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

	cin >> n;

	for(int i = 1; i <= n*2-2; i++)
	{
		getline(cin,str);

		for(s = 0; s < N; s++){

		if(str[s] == 'H' && str[s+1] =='o' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o' 
			|| str[s] == 'H' && str[s+1] =='a' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o'){
			//str[s] = 'H';
			str[s+1] = 'o';
			//str[s+2] = 's';
			//str[s+3] = 'h';
			//str[s+4] = 'i';
			//str[s+5] = 'n';
			str[s+6] = 'a';

			
			//if(str[s] == '\0')
			//	str[s] == '\0';
			//s++;

		}

		}
		cout << str << endl;

	}
}