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 <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

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

C++: n = int(input())
for i in range(n):
  l = [s for s in input().split()]
  for s in l:
    if 'Hoshino' in s:
      l[l.index(s)] = s.replace('Hoshino','Hoshina')
  a = ''
  for s in l:
    a += s
    a += ' '
  a = a.rstrip()
  print(a)

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

using namespace std;

string Tol(string in){
  for(int i = 0; i < in.length(); i++){
    if(in[i] >= 'A' && in[i] <= 'Z') in[i] += ('a'-'A');
  }
  return in;
} 
string check(string s){
  if(s == "Hoshino") return "Hoshina";
  // if(s.length() != 5) return s;
  /* string isw = Tol(s);
  if(isw == "apple"){
    for(int i = 0; i < 5; i++) s[i] += PEACH[i] - APPLE[i];
  }
  if(isw == "peach"){
    for(int i = 0; i < 5; i++) s[i] += APPLE[i] - PEACH[i];
    }*/
  return s;
}

int main(){
  int rev;
  cin >> rev;
  string t;
  getline(cin,t);
    for(int j = 0; j < rev; j++){
      string in;
      getline(cin,in);
      in += '\n';
      vector<string> V;
      string str = "";
      for(int i = 0; i < in.length(); i++){
	if(in[i] >= 'a' && in[i] <= 'z' || in[i] >= 'A' && in[i] <= 'Z')str += in[i];
	else{
	  // if(in != ""){
	  V.push_back(str);
	  str = "";
	  str += in[i];
	  V.push_back(str);
	  str = "";
	  // }
	}
      }
      if(in != ""){
	V.push_back(str);
	str = "";
      }
      for(int i = 0; i < V.size(); i++) cout << check(V[i]);
    }
  return 0;
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;
  string str;
  std::getline(std::cin, str);

  for(int i=0;i<line_length;++i){
    string input;
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }
  return 0;
}

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

int main(){
    std::string str;
    int n;
    
    std::cin >> n;
    for (int i=0;i < n;++i) {
        while (std::cin >> str) {
            if (str == "Hoshino") {
                std::cout << "Hoshina ";
            }
            else if (str == "Hoshino,") {
                std::cout << "Hoshina, ";
            }
            else if (str == "Hoshino.") {
                std::cout << "Hoshina. ";
            }
            else{
                std::cout << str << " ";
            }
        }
        std::cout << std::endl;
    }
    
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	int n;
	cin >> n;
	cin.sync();

	while(n--)
	{
		string str;

		getline(cin, str);

		rep(i, str.size() - 6)
		{
			if(str.substr(i, 7) == "Hoshino")
			{
				str[i += 6] = 'a';
			}
		}

		cout << str << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

void strReplace(string& str, const string& from, const string& to){
	string::size_type pos = 0;
	while(pos = str.find(from, pos), pos != string::npos){
		str.replace(pos, from.length(), to);
		pos += to.length();
	}
}

int main(){
	int n;
	cin >> n;
	cin.clear();
	cin.ignore();
	for(int i = 0; i < n; i++){
		string s;
		getline(cin, s);
		strReplace(s, "Hoshino","Hoshina");
		cout << s << endl;
	}
}

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

int main(void){
	std::string tmp;
	u_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::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp.find("Hoshino") != -1){ //judge word
				tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	if(it == (str.end() - 1)){
           		line = line + *it;
        	}else{
        		line = line + *it + " ";
        	}
        }
        std::cout << line << std::endl;
	}

	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(void)
{
  int n;
  cin >> n;
  getchar();
  for(int i=0;i<n;i++){
    string s;
    getline(cin,s);
    for(int j=0;j<s.size()-6;j++){
      string hos = s.substr(j,7);
      if(hos == "Hoshino"){
	s[j+6] = 'a';
      }
    }
    cout << s << endl;
  }
}