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 <stack>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <utility>
#include <math.h>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>

using namespace std;

int ssearch(string s, string p, string r)
{
    unsigned long sl = s.size();
    unsigned long pl=p.size();
    for(int i = 0; i< sl-pl+1;i++)
    {
        bool ch = true;
        for(int j = 0; j < pl;j++)
        {
            if(s[i] != p[j])
            {
                ch = false;
                break;
            }
        }
        if(ch)
        {
            for(int k = 0; k < pl; k++)
            {
                s[i+k] = r[k];
            }
            i+=pl;
        }
    }
    return 0;
}

int main() {
    
    int n;
    string str;
    getline(cin,str);
    n = atoi(str.c_str());
    for(int t = 0;t<n;t++)
    {

        getline(cin,str);
        ssearch(str,"Hoshino","Hoshina");
        cout << str << endl;
    }

    return 0;
}

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

const string check = "Hoshino";

int main()
{
	int n;
	string str;
	cin >> n;
	getline(cin,str);
	for(int loop=0;loop<n;loop++){
		getline(cin,str);
		for(unsigned i=0;i<str.size();i++){
			bool flag = true;
			for(unsigned j=0;j<check.size();j++){
				if(i+j < str.size()){
					if(str[i+j] != check[j])
						flag = false;
					else{
						if(j == check.size()-1 && flag)
							str[i+j] = 'a';
					}
				}
			}
		}
		cout << str << endl;
	}
	return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int n;
  cin >> n;
  cin.ignore();
  while(n--) {
    string line;
    getline(cin,line);
    REP(i,line.length()-6) {
      if (line.substr(i,7) == "Hoshino")
        line.replace(i,7,"Hoshina");
    }
    cout << line << endl;
  }
}

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

int main(void){
	std::string tmp;
	u_int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore();

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	std::cout << *it << " ";
        }
        std::cout << std::endl;
	}

	return 0;
}

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

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::string text;
    getline(std::cin, num_of_data);
    
    for(u_int i = 0; i < num_of_data; ++i){
        getline(std::cin, text);
        u_int index = 0;
        
        while((index = text.find(str_false, index)) != std::string::npos){
            text.replace(index, str_false.size(), str_true);
            index += str_false.size() + 1;
        }
        std::cout  << text << std::endl;
    }
    
    return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	string a;

	cin >> n;
	cin.ignore();

	for (int i = 0; i < n; ++i){
		int x = 0;
		getline(cin, a);
		if ((x = a.find("Hoshino")) >= 0)
			a.replace(x, strlen("Hoshino"), "Hoshina");
		cout << a << endl;
	}
	
	return 0;
}

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

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        std::string text;
        getline(std::cin, text);
        
        u_int index = 0;
        while((index = text.find(str_false, index)) != std::string::npos){
            text.replace(index, str_false.size(), str_true);
            index += str_false.size() + 1;
        }
        std::cout  << text << std::endl;
    }
    
    return 0;
}

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

int main(){
  int n;
  string str="";
  queue<string> questr;
  stringstream ss;

  cin>>n;
  for(int i=0;i<n;i++){
	 for(;;){
		getline(cin,str);
		if(str!="") break;
	 }
	 ss<<str;str="";
	 for(;;){
		ss>>str;
		if(str=="") break;
		if(str=="Hoshino") str="Hoshina";
		questr.push(str);
		str="";
	 }

	 cout<<questr.front();questr.pop();
	 while(!questr.empty()){
		cout<<" "<<questr.front();
		questr.pop();
	 }
	 cout<<endl;

	 ss.str("");
	 ss.clear(stringstream::goodbit);
	 while(!questr.empty()) questr.pop();
  }
  return 0;
}

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

int main(void)
{
	int N;
	

	scanf("%d", &N);
	fflush(stdin);
	while(--N, N>=0){
		char instr[1001];
		char *t;

		gets(instr);
		while( (t = strstr(instr, "Hoshino")) != NULL){
			t += 6;
			*t = 'a';
		}

		printf("%s\n", instr);
	}


	return 0;
}

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

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

	scanf("%d", &n);
	for (int i = 0; i < n+1; i++) {
		fgets(str, 1000, stdin);

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

	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>

using namespace std;

int n;
string s;


string find_str = "Hoshino";	// 検索対象の文字列
string rep_str = "Hoshina";

int main(){
    
        
    while(cin>>n){
        cin.ignore();
        for(int i=0; i<n; i++){
            getline(cin, s);
            int f;
            while((f=s.find("Hoshino"))!=-1){
                s.replace(f, find_str.length(), rep_str);
            }
            cout<<s<<endl;

        }
        
    }
    
}

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

int main(){
	string str;
	int n;
	cin >> n;
	getline(cin, str);
	for (int i = 0; i < n; i++) {
		getline(cin, str);
		for (int j = 0; j < int(str.size()) - 6; j++) {
			if (str[j] == 'H') {
				if (str.substr(j + 1, 6) == "oshino")str.replace(j, 7, "Hoshina");
				else if (str.substr(j + 1, 6) == "oshina")str.replace(j, 7, "Hoshino");
			}
		}
		cout << str << endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define ITER( c ) __typeof( c ).begin()
#define REP( i, m, n ) for ( int i = m; i < n; i++ )
#define UREP( i, m, n ) for ( unsigned int i = m; i < n; i++ )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) c.begin(), c.end()
#define PB( n ) push_back( n );
#define MP( a, b ) make_pair( a, b )
#define fst first
#define snd second

int main()
{
	int n;
	cin >> n;
	cin.ignore( 1 );

	REP( i, 0, n )
	{
		string line;
		getline( cin, line );

		while ( true )
		{
			int pos = line.find( "Hoshino", 0 );
			if ( pos == string::npos )
			{
				break;
			}
			else
			{
				line.replace( pos, 7, "Hoshina" );
			}
		}

		cout << line << endl;
	}

	return 0;
}