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 <stdio.h>
#include <stdlib.h>
using namespace std;
int main(){
  int n, i, s, g;
  string a;
  cin>>n;
  for(g=0; g < n;g++){
      getline(cin,a);
      if(a==""){
        g--; 
        continue;
      }
      for(i=6; i <= a.size();i++)
      if(a[i-6]== 'H' &&a[i-5]== 'o' &&a[i-4]== 's' &&a[i-3]== 'h' &&a[i-2]== 'i' &&a[i-1]== 'n' &&a[i]== 'o')
      a[i-5]='a';   
      cout<<a<<endl;
  } 
  return 0; 
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(){

  int n, idx;
  string s;

  cin >> n;

  for(int i = n; i >= 0; --i){

    getline(cin, s);

    while((idx = s.find("Hoshino", 0)) != string::npos){

      s[idx + 6] = 'a';

    }

    cout << s << endl;

  }

}

C++: #include <bits/stdc++.h>

using namespace std;
 
int main()
{
    string str;
    int n;
     
    cin >> n;
    cin.ignore();
    while (n--) {
        getline(cin, str);
        for (int j = 0; j < (int)str.size()-7; j++) {
            string key = str.substr(j, 7), repl;
            if (key == "Hoshino") {
                repl = "Hoshina";
                for (int k = 0; k < n; k++) {
                    str[j+k] = repl[k];
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

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

using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  getline(cin, s);
  for (int i = 0; i < n; i++) {
    getline(cin, s);
    for (int i = 6; i < s.length(); i++)
      if (s[i-6] == 'H' &&
          s[i-5] == 'o' &&
          s[i-4] == 's' &&
          s[i-3] == 'h' &&
          s[i-2] == 'i' &&
          s[i-1] == 'n' &&
          s[i] == 'o')
        s[i] = 'a';
    cout << s << endl;
  }
  return 0;
}

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


int n;
std::string str;


std::string substg(int a, int b) {
	std::string res = "";
	for (int i = a; i < a + b; i++) {
		res += str[i];
	}

	return res;
}

void replace(int a) {
	std::string hoge = "Hoshina";

	for (int i = a; i < a + 7; i++) {
		str[i] = hoge[i - a];
	}
}

void solve() {
	int i = 0;
	while (i <= (signed)(str.size() - 7)) {
		if (substg(i, 7) == "Hoshino") {
			replace(i);
			i += 7;

			continue;
		}

		i++;
	}

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




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

	std::cin.ignore();

	for (; n > 0; n--) {
		std::getline(std::cin, str);

		solve();
	}

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;c=getchar();
	for(j=0;j<n;j++){
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c=='\n'){
	   break;
	  }else{
	   switch(flg){
		case 0:
		if(c=='H'){flg++;}
		break;
		case 1:
		if(c=='o'){flg++;}else{flg=0;}
		break;
		case 2:
		if(c=='s'){flg++;}else{flg=0;}
		break;
		case 3:
		if(c=='h'){flg++;}else{flg=0;}
		break;
		case 4:
		if(c=='i'){flg++;}else{flg=0;}
		break;
		case 5:
		if(c=='n'){flg++;}else{flg=0;}
		break;
		case 6:
		if(c=='o'){c='a';}
		flg=0;
		break;
	   }
	   cout<<c;
	  }
	 }
	 cout<<endl;
	}
	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, 80, stdin);

		if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
		printf("%s\n", str);
	}

	return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
int main(){
	int n;
	char s[1050],ha[]="Hoshina",ho[]="Hoshino";
	cin>>n;
	while(n-->0){
		fgets(s,1050,stdin);
		for(int i=0;i<strlen(s);i++){
			if(i==0){
				if(!strncmp(&s[i],ho,7)&&(s[i+7]==' '||s[i+7]=='\n'||s[i+7]=='\0')){
					strncpy(&s[i],ha,7);
				}
			}
			else{
				if(!strncmp(&s[i],ho,7)&&(s[i+7]==' '||s[i+7]=='\n'||s[i+7]=='\0')&&s[i-1]==' '){
					strncpy(&s[i],ha,7);
				}
			}
		}
		cout<<s;
	}
	return 0;
}

C++: //#include <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
	for(int j = 0; j<= n; j++)
	{
	
		char s[MAX_SIZE] = {};
		gets(s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hoshina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}
		if(j != 0) cout << endl;
	}
	return 0;

}

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

int main() {
	int n;

	cin >> n;
	getchar();
	for (int i = 0; i < n; i++) {
		char str[1001];
		gets(str);
		for (int j = 0, len = strlen(str); j < len - 6; j++) {
			if (strncmp(&str[j], "Hoshino", strlen("Hoshino")) == 0) {
				strncpy(&str[j], "Hoshina", strlen("Hoshina"));
			}
		}
		cout << str << endl;
	}
	return 0;
}

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

using namespace std;

string str;
string hoshino = "Hoshino";
int hlen = hoshino.length();

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;
	
	scanf("%d", &n);
	
	for (int i = 0; i < n; i++) {
		getline(cin, str);

		changeHoshino(str.length());

		cout << str << endl;
	}

	return 0;
}

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



int main(){
	std::string str;
	int data_num;
	std::cin >> data_num;
	std::cin.ignore();
	for(int i = 0; i < data_num; ++i){
		u_int loc = 0;
		u_int size;
		getline(std::cin, str);
		size = str.size();
		while(1){
			loc = str.find("Hoshino", loc);
			if(loc == std::string::npos || loc == size){
				break;
			}
			str[loc+6] = 'a';
			++loc;	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

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

int main(){
    int n;
    std::string str;
    std::string fr = "Hoshino";
    std::string to = "Hoshina";
    std::string::size_type pos;
    std::cin >> n;
    std::cin.get();
    
  
        //文字列の読み込み
        while(n > 0 && std::getline(std::cin, str)){
            //"Hoshino"を"Hoshina"に変換
            pos = str.find(fr);
            while(pos != std::string::npos){
                str.replace(pos, fr.size(), to);
                pos = str.find(fr, pos+to.size());
            }
             std::cout << str << std::endl;
            str = "";
            std::cin.clear();
            --n;
        }
}

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

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

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