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

	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
int main(){
    int n;
    cin >> n;
    string str;
    getline(cin,str);
    rep(i,n){
        getline(cin,str);
        int k = str.size();
        rep(j,k){
            if(str[ j ] == 'H' && j+1 < k){
            if(str[j+1] == 'o' && j+2 < k){
            if(str[j+2] == 's' && j+3 < k){
            if(str[j+3] == 'h' && j+4 < k){
            if(str[j+4] == 'i' && j+5 < k){
            if(str[j+5] == 'n' && j+6 < k){
            if(str[j+6] == 'o'){ 
                str[j+6] = 'a'; 
            }}}}}}}
        }
        cout << str << endl;
    }
    return 0;
}

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

using namespace std;

int main() {
	int n;
	string str;
	cin >> n;
	cin.ignore();
	while(n--) {
		getline(cin, str);
		int num;
		while(num = str.find("Hoshino"), num != -1) {
			str[num + 6] = 'a';
		}
		cout << str << endl;
	}
	return 0;
}

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

int main(){
	std::string correctword = "Hoshina";

    int dataSetNum;
    std::cin >> dataSetNum;

    std::vector< std::string > str;
    str.resize(dataSetNum);
    std::cin.ignore();

    //input 
    for(int i = 0; i < dataSetNum; ++i){
        //input
        std::string tmp;
        getline(std::cin, tmp);
        str[i] = tmp;
    }

    //replace
    for(int i = 0; i < dataSetNum; ++i){
    	std::string tmp = "Hoshino";
        //std::string::size_type pos = str[i].find(tmp);
        auto pos = str[i].find(tmp);
        while(pos != std::string::npos){
        	str[i].replace(str[i].begin() + pos, str[i].begin() + pos + 7, correctword.begin(), correctword.end() );
        	pos = str[i].find(tmp, pos + 7);
        }

    }
    
    //output
    for(int i = 0; i < dataSetNum; ++i){
    	std::for_each(str[i].begin() , str[i].end(),
    [](std::string x) { std::cout << x << 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;
	cin.ignore();

	for(int i = 0; i < n; i++)
	{
		getline(cin,str);

		for(s = 0; s < N-7; 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+1] = 'o';
				str[s+6] = 'a';
			}

		}
		cout << str << endl;

	}
}

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

int main() {
	int n;
	cin >> n;
	getchar();
	for (int i = 0;i < n;i++) {
		string s;
		getline(cin, s);
		int a = s.size();

		if (a >= 7) {
			for (int j = 0;j < a - 6;j++) {
				string sb;
				sb = s.substr(j, 7);
				if (sb == "Hoshino") {
					s.replace(j, 7, "Hoshina");
				}
			}
		}
		cout << s << endl;
	}
	return 0;
}