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 <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int n;
  string in;
  cin>>n;
  getline(cin,in);
  while(n--){
    string str;
    getline(cin,str);;
    if(str.size()<7){
      cout<<str<<endl;
      continue;
    }
    rep(i,str.size()-7){
      if(str[ i ] == 'H' && str[i+1] == 'o' && str[i+2] == 's' && str[i+3] == 'h' &&
	 str[i+4] == 'i' && str[i+5] == 'n' && str[i+6] == 'o'){
	str[i+6] = 'a';
      }
    }
    cout<<str<<endl;
  }

}

C++: #include <stdio.h>
#include <string.h>
char h[]="Hoshino";
int main(){
    int n,i;
    scanf("%d ",&n);
    for(i=0;i<n;i++){
        int j,l;
        char s[1001];
        gets(s);
        l=strlen(s);
        for(j=0;j<l-6;j++){
            int k=0;
            while(s[j+k]==h[k]){
                k++;
                if(k==7){
                    s[j+6]='a';
                    k=0;
                    break;
                }
            }
        }
        printf("%s\n",s);
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>





using namespace std;


int main()
{
	int count;
	string input, _input;

	getline(cin, _input);

	count = stoi(_input);

	for (int i = 0; i < count; i++)
	{
		getline(cin, input);
	

		while (input.find("Hoshino") != string::npos)
		{
			input.replace(input.find("Hoshino"), 7 ,"Hoshina");
		}

		cout << input << endl;
	}

	



}

C++: #include<iostream>
#inlcude<string>
int main(){
	int a;
	std::cin>>a;
	for(int i=0;i<a+1;i++){
		std::string str;
		std::getline(std::cin,str);
		for(int j=0;j<str.size();j++){
			if(str[j]=='H'&&str[j+1]=='o'&&str[j+2]=='s'&&str[j+3]=='h'&&str[j+4]=='i'&&str[j+5]=='n'&&str[j+6]=='o'){
				str[j+6]='a';
			}
		}
		std::cout<<str<<std::endl;
	}
	
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	string s;
	getline(cin,s);
	while(n--){
		vector<int> b;
		getline(cin,s);
		int pos = 0;
		while(~s.find("Hoshino",pos)){
			pos = s.find("Hoshino",pos)+1;
			b.push_back(pos-1);
		}
		for(int i=0;i<b.size();i++)
			s.replace(b[i],7,"Hoshina");
		cout << s << endl;
	}
}

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

static void inputSentences(std::vector<std::string>& sentences, int n)
{
  fflush(stdin);
  for (int i = 0; i < n; i++) {
    std::string inputSentence;
    getline(std::cin, inputSentence);
    sentences.push_back(inputSentence);
  }
}

static void convertSentencesCore(const std::string& targetBase,
                                 const char afterConvert,
                                 int convertPos,
                                 std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    /* ?????¬ */
    if (*it == targetBase) {
      it->at(convertPos) = afterConvert;
      continue;
    }
    if (it->size() <= targetBase.size()) {
      continue;
    }
    while(true) {
      int find;
      std::string targetStr;
      bool findFlg = false;
      /* ?????? */
      targetStr = " " + targetBase + " ";
      find = it->find(targetStr);
      if (find != std::string::npos) {
        it->at(find + convertPos + 1) = afterConvert;
        findFlg = true;
      }
      /* ?????? */
      targetStr = targetBase + " ";
      find = it->find(targetStr);
      if (find == 0) {
        it->at(convertPos) = afterConvert;
        findFlg = true;
      }
      /* ????°? */
      targetStr = " " + targetBase;
      find = it->find(targetStr);
      if (find == it->size() - targetBase.size() - 1) {
        it->at(find + convertPos + 1) = afterConvert;
        findFlg = true;
      }
      if (findFlg == false) {
        break;
      }
    }
  }
}

static void convertSentences(std::vector<std::string>& sentences)
{
  convertSentencesCore("Hoshino", 'a', 6, sentences);
  convertSentencesCore("Hoshino,", 'a', 6, sentences);
  convertSentencesCore("Hoshino.", 'a', 6, sentences);
}

static void outputSentences(std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    std::cout << *it << std::endl;
  }
}

int main(void)
{
  int n;
  std::vector<std::string> sentences;

  std::cin >> n;

  inputSentences(sentences, n);
  convertSentences(sentences);
  outputSentences(sentences);

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin>>n;

for (int i = 0; i < n; ++i) {
	string s;
	string a;
	cin.ignore();
	getline(cin,s);
	stringstream ss(s);
	string ret;
	bool b=false;
	while(!ss.eof()){
		ss>>ret;
		if(b)cout<<" ";
		b=true;
		if(ret=="Hoshino"){cout<<"Hoshina";}
		else{cout<<ret;}
	}cout<<endl;
}
}

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

using namespace std;

int main()
{
	char n[10],str[2000];

	fgets(n,sizeof(n),stdin);

	for(int i=0;i<atoi(n);i++){
		fgets(str,sizeof(str),stdin);
		for(int j=0;str[j]!=NULL;j++){
			if(str[j]=='o' && j>=6){
				if(str[j-6]=='H'&&str[j-5]=='o'&&str[j-4]=='s'&&str[j-3]=='h'&&str[j-2]=='i'&&str[j-1]=='n') str[j]='a';
			}
		}
		cout<<str;
	}
	return 0;
}

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

int main() {

	int n;//dataset
	std::string st_1,st_2;

	st_2 = "Hoshino";

	std::cin >> n;
	std::cin.ignore();

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

		std::string::size_type pos = st_1.find(st_2);

		while (pos != std::string::npos) {
			st_1.replace(pos, st_2.length(), "Hoshina");
			pos = st_1.find(st_2,pos+st_2.length());
		}

		std::cout << st_1 << std::endl;

	}

	return 0;
}

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

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    std::cin >> data_set_num;
    std::cin.ignore();
    //std::getline(std::cin,str);
    //sscanf(str.c_str(),"%d ",&data_set_num);

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  int n;
  cin >> n;
  cin.ignore();
  for(int i=0;i<n;i++){
    getline(cin,s);
    while(s.find("Hoshino")!=string::npos){
      s.replace(s.find("Hoshino"),7,"Hashino");
    }
    cout<<s<<endl;
  }
}