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 <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

entry:

  int n; cin >> n;
  if (n == 0) return 0;
  {
    char c;
    scanf("%c", &c);
  }

  while (n--) {
    for (int st = 0;;) {
      char c;
      scanf("%c", &c);
      if (c == '\n') break;
      if (st == 0 && c == 'H') st = 1;
      else if (st == 1 && c == 'o') st = 2;
      else if (st == 2 && c == 's') st = 3;
      else if (st == 3 && c == 'h') st = 4;
      else if (st == 4 && c == 'i') st = 5;
      else if (st == 5 && c == 'n') st = 6;
      else if (st == 6 && c == 'o') st = 7;
      else st = 0;

      if (st == 7) {
        st = 0;
        cout << 'a';
      }
      else {
        cout << c;
      }
    }
    cout << endl;
  }

  goto entry;

  return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

using namespace std;

int main(){
	int n,check;
	string str;
	cin >> n;
	for(int i=0;i<=n;i++){
		getline(cin,str);
		if(str.find("Hoshino") != string::npos){
			str.replace(str.find("Hoshino"),7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<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 <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 1000000000
#define EPS 0.000001
#define MAX_N 2000

int n;

char str[1001];
char check[] = "Hoshino";
void solve();
int counter(char str[]);

int main(){

	cin >> n;

	for(int i = 0; i <= n; i++){
		gets(str);
		solve();
	}
 
	return 0;
 
}
 
int counter(){

	int ans = 0;
	for(; ; ans++){
		if(str[ans] == '\n'){
			break;
		}
	}

	return ans;

}

void solve(){

	int L = counter();
	int C = 0;
	for(int i = 0; i < L-6; i++, C = 0){
		for(int j = i; C < 7; j++){
			if(str[j] == check[C]){
				C++;
			}
			else
				break;
		}
		if(C==7){
			str[i+C-1] = 'a';
		}
	}

	printf("%s\n", str);

}

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

int main( void )
{
	string search_text = "Hoshino";
	string replace_text = "Hoshina";

	int n;
	char c;
	cin >> n;
	cin.get();

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

		while ( text.find( search_text ) != string::npos )
		{
			text.replace( text.find( search_text ), replace_text.length(), replace_text );
		}
		cout << text << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int compare(const std::string& buf, const std::string& str)
{
}

int main(int argc, char const *argv[])
{
	int n;
	std::string s;
	std::getline(std::cin, s);
	std::stringstream ss(s);
	ss >> n;
	REP(i, n)
	{
		std::getline(std::cin, s);
		int k = 0;
		int l = s.length();
		while(k+7 <= l)
		{
			if (s.substr(k, 7) == "Hoshino")
				s.at(k+6) = 'a';
			k++;
		}
		std::cout << s << std::endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int num;
  cin >> num;
  string trash;
  getline(cin,trash);
  for(int j = 0; j < num; j++){
    string in;
    getline(cin,in);
    int status = 1;
    string out;
    in += '\n';
    for(int i = 0; i < in.length(); i++){
      if(status){
	if(in[i] >= 'a' && in[i] <= 'z'|| in[i] >= 'A'&& in[i] <= 'Z'){
	  if(i == in.length()-1) cout << in[i];
	  out = in[i];
	  status = 0;
	  continue;
	}
      }
      if(in[i] >= 'a' && in[i] <= 'z'|| in[i] >= 'A'&& in[i] <= 'Z'){
	out += in[i];
	status = 0;
      }else{
	if(out == "Hoshino") cout << "Hoshina" << in[i];
	else cout << out << in[i];
	status = 1;
      }
    }
  }
  return 0;
}

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

int main()
{
	int n;
	char str[1001];

	scanf("%d\n", &n);
	for (int i = 0; i < n; i++) {
		fgets(str, sizeof(str), stdin);

		while (1) {
			if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
			else break;
		}
		printf("%s", str);
	}

	return 0;
}