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 <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, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

C++: #include <iostream>
#include <sstream>
#include <vector>
 
int main(void){
    int n; //number of data set
 
    std::cin >> n; //input number of data set
    std::cin.ignore(); //delete cin buffer
 
    for(size_t i = 0; i < n; ++i){
        std::vector<std::string> str; //string data
        std::string line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
            if(it == (str.end())){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string str;vector<string> vs;
    vs.clear();
    // while(cin>>str){
    for(int s=0;s<8;s++){
      cin>>str;
      if(str=="Hoshino"){
	vs.push_back("Hoshina");
      }else
	vs.push_back(str);
    }
    for(int j=0;j<vs.size();j++){
      cout<<vs[j];
      if(j!=vs.size()-1)
	cout<<" ";
    }
    cout<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main()
{
	int n;
	scanf("%d%*c", &n);
	for (int i = 0; i < n; i++){
		string m;
		
		getline(cin, m);
		while (m.find("Hoshino") != -1){
			m.replace(m.find("Hoshino"), 7, "Hoshina");
		}
		cout << m << endl;
	}
	return (0);
}

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

C++: #include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
#include <string>
 
int main(){
    int dataSetNum;
    std::cin >> dataSetNum;

    //std::vector<string> *str = new std::vector<string>[dataSetNum];
    std::vector< std::vector< std::string > > str;
    str.resize(dataSetNum);
    std::cin.ignore();
    //input & sprit
    for(int i = 0; i < dataSetNum; ++i){
        //input
        std::string tmp;
        std::string buf;
 
        std::cin >> tmp;
 
        std::stringstream ss(tmp);
        //sprit
        while( getline(ss, buf, ' ') ){
            str[i].push_back(buf);
        }
    }
 
    //replace
    for(int i = 0; i < dataSetNum; ++i){
        std::replace_if(str[i].begin(), str[i].end(),
    [](std::string x) { return x == "Hoshino"; }, "Hoshina");
    }
 
    //output
    for(int i = 0; i < dataSetNum; ++i){
        std::for_each(str[i].begin(), str[i].end(),
    [](std::string x) { std::cout << x << ' '; });

        std::cout << std::endl;
    }
 
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

int main(){
	int n;
	cin>>n;
	string t;
	getline(cin,t);
	rep(i,n){
		string s;
		getline(cin,s);
		// cout<<s.size()<<endl;
		if(s.size()<7){
			cout<<s<<endl;
			continue;
		}
		rep(j,s.size()-6){
			if(s.substr(j,7)=="Hoshino"){
				//cout<<"hoge"<<endl;
				//cout<<s[j+6]<<endl;
				s[j+6]='a';
			}
		}
		cout<<s<<endl;
	}
	return 0;
}

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

using namespace std;

int main() {
  int n;

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

    int pos;
    while ((pos = s.find("Hoshino")) != -1) {
      s[pos + 6] = 'a';
    }
    cout << s << endl;
  }
  return 0;
}

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

int main(){
  int n;
  int i = 0;
  int flag = 0;
    std::array<std::string, 1000> str = {};

  std::cin >> n;

  while(n > 0){
    while(std::cin >> str[i]){
      ++flag;
        ++i;
    }
      for(int j = 0;j < flag;++j){
          if(str[j] == "Hoshino")
              str[j] = "Hoshina";
      }
      for(int j = 0;j < i;++j){
          std::cout << str[j];
      }
      std::cout << endl;
      
      flag = 0;
      i = 0;
      --n;
  }
}

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

int main(){
  std::string sent;
  int gyou,num;
  std::cin >> gyou;
  getline(std::cin, sent);
  for(int i=0;i<gyou;i++){
    getline(std::cin, sent);
    std::string bef="Hoshino",aft="Hoshina";
    num=(int)sent.find(bef);
    if(num!=-1)
    sent.replace(num,bef.size(),aft);
    std::cout << sent;
    if(i<gyou-1)
    std::cout << std::endl;
  }
  return 0; 
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <fstream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <assert.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define ALL(s) (s).begin(),(s).end()
#define ITE(c) typeof((c).begin())

#define clr(a) memset((a),0,sizeof(a))
#define nclr(a) memset((a),-1,sizeof(a))
#define pb push_back
#define INRANGE(x,s,e) ((s)<=(x) && (x)<(e))
#define MP(a,b) make_pair((a),(b))

using namespace std;

int main(){
	int n;
	string str;
	cin>>n;
	cin.get();
	rep(j,n){
		getline(cin,str);
		for(int i=6;i<str.size();i++){
			if(str.substr(i-6,7)=="Hoshino"){
				str[i]='a';
			}
		}
		cout<<str<<endl;
	}
	return 0;
}