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>
using namespace std;

//ツ閉カツ篠堋療アsツづ景dxツ氾板姪堋つゥツづァ, ツ閉カツ篠堋療アtargetツつェツ出ツ個サツつキツづゥツつゥツづーツ板サツ津ィツつキツづゥ
bool check(string s, string target, int idx){
  for(int i = 0; i < target.size(); i++){
    if(s.length() <= idx + i){
      return false;
    }
    if(s[idx + i] != target[i]){
      return false;
    }
  }

  return true;
}

int main(){
  string s;
  int n;
  cin >> n;

  getline(cin, s); //ツ催?渉可づ個青ョツ青板づーツ偲ヲツづ?つスツつ?づ?づ個嘉シツ行ツつェツ残ツづ?づ?つ「ツづゥツづ個づ? ツ偲ヲツづ?づ?つィツつュ

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

    for(int i = 0; i < s.length(); i++){
      //iツ閉カツ篠堋姪堋つゥツづァ"Hoshino"ツづ可づ按づ?づ?つ「ツづゥツづ按づァ, "Hoshina"ツづ可置ツつォツ環キツつヲ
      if(check(s, "Hoshino", i)){
        s[i + 6] = 'a';
      }
      //iツ閉カツ篠堋姪堋つゥツづァ"Hoshina"ツづ可づ按づ?づ?つ「ツづゥツづ按づァ, "Hoshino" ツづ可置ツつォツ環キツつヲ
      else if(check(s, "Hoshina", i)){
        s[i + 6] = 'o';
      }
    }

    cout << s << endl;
  }
}

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

using namespace std;

int main(){
	string s;
	int n;
	getline(cin,s);n=s[0]-'0';
	while(getline(cin,s),n--){
		for(int i=0;i<s.size()-5;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+1]='a';s[i+6]='o';
			}
		}
		
		cout<<s<<endl;
		
	}

}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

bool is_change(string& str,int pos, int len){
	const char A[] = {'H','o','s','h','i','n','a'};
	if(str.substr(pos,len) == "Hoshino"){
		for(int i=pos,j=0;i<pos+len,j<7;i++,j++){
			str[i] = A[j];
		}
		return true;
	}

	return false;
}

int main(){

	string str;
	while(getline(cin,str)){
		int n;
		sscanf(str.c_str(),"%d",&n);
		for(int idx=0;idx<n;idx++){
			getline(cin,str);
			for(int i=0;i+6<str.size();i++){
				if(is_change(str,i,7)) i+=7;
			}

			cout << str << endl;
		}
	}
}

C++: #include<iostream>
using namespace std;
main(){
	int n;
	cin>>n;
	cin.ignore();
	for(int i=0;i<n;++i){
		string str;
		getline(cin,str);
		int n=str.find("Hoshino");
		str[n+6]='a';
		cout<<str<<endl;
	}
}

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

using namespace std;

int main(){
    int num=0;
    string str;
    string target = "Hoshino";
    string dest = "Hoshina";
    cin >> num;
    cin.ignore();
    
    for(int j=0;j<num;j++){
        getline(cin,str);
        string::size_type index = str.find(target);
        
        while(index != string::npos){
            str.replace(index,target.length(),dest);
            index = str.find(target,index+dest.length());
        }
        cout << str <<endl;
    }
    return 0;
}

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

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

using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

int main(){
    int n;
    cin >> n;
    cin.ignore();
    rep(_, n){
        string s;
        getline(cin, s);
        stringstream ss(s);
        string t;
        vector<string> input;
        while (ss >> t){
            input.push_back(t);
        }
        rep(i, input.size()){
            if (input[i] == "Hoshino"){
                cout << "Hoshina";
            }
            else{
                cout << input[i];
            }
            if (i == input.size() - 1)cout << endl;
            else cout << " ";
        }
    }
}

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

int main() {
	int n;
	string s;

	cin >> n;
	cin.ignore();
	for(int i = 0; i < n; i++) {
		getline(cin, s);
		for(int j = s.find("Hoshino", 0); j != string::npos; j = s.find("Hoshino", j + 1)) {
			s[j + 6] = 'a';
		}
		cout << s << endl;
	}

}

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

void Hoshina(string& str){
	if(str.size() < 7){
	} else {
		for(unsigned int i=0; i<str.size()-6; ++i){
			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;
}

int main() {
	int n;
	string str;
	cin >> n;
	cin.ignore();
	for(int i=0; i<n; ++i){
		getline(cin,str);
		Hoshina(str);
	}
	return 0;
}

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

int main()
{
	int datasets;
	scanf("%d\n", &datasets);
	
	for (int i=0; i<datasets; i++) {
		std::string str;
		getline(std::cin, str);
		//std::cout << str << std::endl;
		int offset = 0;
		while (true) {
			int pos = str.find("Hoshino", offset);
			if ( pos != std::string::npos ) {
				str.replace(pos, 7, "Hoshina");
				offset = pos + 7;
			} else {
				break;
			}
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    int n;cin>>n;
    char c; scanf("%c",&c);
    rep(p,n){
        string s;
    getline(cin,s);
        rep(i,s.length()){
        int b=(int)s.find("Hoshino",i);
        if(b!=-1){s.replace(b+i,7,"Hoshina");i+=7;}
    }
        cout<<s<<endl;
    }
}

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

using namespace std;

int main(){
  int n;
  scanf("%d\n", &n);
  int i;
  for(i=0;i<n;i++){
    char str[1000];
    //scanf("%[^\n]", str);
    fgets(str, 1000, stdin);
    string s(str);
    int index=0;
    while((index=s.find("Hoshino", index)) != string::npos)
      s.replace(index, 7, "Hoshina");

    printf("%s", (s.c_str()));
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n; scanf("%d%*c", &n);
	rep(i, n) {
		string s; getline(cin, s);
		regex re("Hoshino");
		cout << regex_replace(s, re, "Hoshina") << endl;
	}
}

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

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, '\t')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += ('\t' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}