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 <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int compare(const std::string& buf, const std::string& str)
{
}

int main(int argc, char const *argv[])
{
	int n;
	std::string str1 = "Hoshino";
	std::string str2 = "Hoshina";
	int len = str1.length();
	scanf("%d\n", &n);
	REP(i, n)
	{
		std::string s;
		std::getline(std::cin, s);
		int k = 0;
		int l = s.length();
		while(k+6 < l)
		{
			int n = 0;
			for (int j = 0; j < 7; j++)
			{
				if (s[k+j] != str1[j])
				{
					n = j+1;
					break;
				}
			}
			if (n == 0)
			{
				s[k + 6] = 'a';
				n = 7;
			}
			k += n;
		}
		std::cout << s << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int n;
string s;

int main(){
	cin >> n;
	cin.ignore();
	REP(i, n){
		getline(cin, s);
		bool f = 0;
		for (int i = 0; i < s.size() - 6; i++){
			string t = s.substr(i, 7);
			if (t == "Hoshino"){
				s[i + 6] = 'a';
			}
		}
		cout << s << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int n;
	string s;
	string d="Hoshina";
	cin>>n;
	while(n--){
		while(getline(cin,s)!="\n");
		while(1){
			unsigned int loc = s.find("Hoshino");
			if(loc!=string::npos)
			s.replace(loc,d.size(),d);
			else
				break;
		}
		cout<<s<<endl;
	}
}

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

int main(void) {
	int i,j;
	int n = 0;
	char strsent[50][1000] = { 0 };
	char work[1000] = { 0 };
	scanf("%d", &n);
	getchar();
	for(i = 0; i < n; i++) {
		// ???????????\???
		gets(strsent[i]);
	}
	for(i = 0; i < n; i++) {
		for(j = 0; strsent[i][j] != '\0'; j++){
			// null?????§??????
			if(	strsent[i][j+1] == '\0' ||
				strsent[i][j+2] == '\0' ||
				strsent[i][j+3] == '\0' ||
				strsent[i][j+4] == '\0' ||
				strsent[i][j+5] == '\0' ||
				strsent[i][j+6] == '\0' ) {
				// ???????????????????????°?????????????????§??????
				break;
			}
			if(	strsent[i][j]   == 'H' &&
				strsent[i][j+1] == 'o' &&
				strsent[i][j+2] == 's' &&
				strsent[i][j+3] == 'h' &&
				strsent[i][j+4] == 'i' &&
				strsent[i][j+5] == 'n' &&
				strsent[i][j+6] == 'o' ) {
				// Hoshino?????´??????Hoshina????¨???£
				strsent[i][j+6] = 'a';
			}
		}
		printf("%s\n", strsent[i]);
	}
	return 0;
}

C++: #include <stdio.h>
#include<math.h>
#include <algorithm>
#include <queue>

using namespace std;

int main(){
	int n;
	char buf[1100];

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

	for(int i=0; i < n; i++){
		fgets(buf,1100,stdin);

		for(int k=0; buf[k] != '\n' && buf[k] != '\n'; k++){
			if(k >= 6 && buf[k] == 'o' && buf[k-1] == 'n' && buf[k-2] == 'i'&&
					buf[k-3] == 'h' && buf[k-4] == 's' && buf[k-5] == 'o' && buf[k-6] == 'H'){
				buf[k] = 'a';
			}
		}

		printf("%s",buf);
		buf[0] = '\0';
	}


    return 0;
}

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

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 <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#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>

static const std::string MISS_STR = "Hoshino";

int main(void) {
    int n;
    std::cin >> n;
    getchar();

    while (0 < n--) {
        std::string str;
        std::getline(std::cin, str);

        const unsigned int str_size = str.size();
        unsigned int cur = 0;
        std::string::size_type pos = str.find(MISS_STR, 0);

        while (pos != std::string::npos && cur <= str_size) {
            str[pos + 6] = 'a';

            // increase cursor
            cur += (pos + MISS_STR.size());
            pos = str.find(MISS_STR, cur);
        }

        std::cout << str << std::endl;
    }

    return 0;
}

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

string t = "Hoshino";

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) == t) { str[i+6] = 'a'; i+=7; }
    }
    cout << str << endl;
  }
  
  return 0;
}

C++: #include <iostream>

using namespace std;

void replaceAll(string &str,const string from,const string to){
  string::size_type pos = 0;
  while((pos=str.find(from))!= string::npos)
    {
      str.replace(pos,from.size(),to);
    }
}
int main(){
  int n;
  cin >> n;
  string line;
  getline(cin , line);
  while(n--){
    getline(cin, line);
    replaceAll(line, "Hoshino","Hoshina");
    cout << line << endl;
  }
  return 0;
}

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

int main(){
	int n;
	string str;
	
	cin >> n;
	cin.ignore();
	while(getline(cin,str)){
		int pos;
		while( (pos=str.find("Hoshino",0)) != string::npos ){
			str.erase(pos,7);
			str.insert(pos,"Hoshina");
		}
		
		cout << str << endl;
	}
}

C++: #include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	string s;
	int n;
	cin>>n;
	cin.ignore();
	rep(i,n){
		getline(cin,s);
		int size=s.size();
		rep(j,size-6){
			string point=s.substr(j,7);
			if(point=="Hoshino"){
				point="Hoshina";
				s.replace(j,7,point);
			}
		}
		cout<<s<<endl;
	}
	return 0;
}

C++: #include<iostream>#include<string>using namespace std;int main(){char ch;int n;cin>>n;cin.get(ch);for(int i=0;i<n;i++){string str;while(1){cin.get(ch);if(ch=='\n')break;str+=ch;}while(1){int idx=str.find("Hoshino");if(idx==-1)break;str[idx+6]='a';}cout<<str<<endl;}return 0;}