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>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <bitset>
#include <complex>
using namespace std;
 
const double EPS = 1e-9;
const double PI = 3.14159265359;
 
typedef complex<double> P;

typedef long long int li;

int main(){
	int n;
	string hos = "Hoshino";

	cin >> n;
	cin.ignore();
	while(n--){
		string s;
		getline(cin, s);

		int k = s.size()+1-hos.size();
		for(int i = 0; i < k; i++){
			if(s.substr(i, hos.size()) == hos){
				s[i+hos.size()-1] = 'a';
			}
		}

		cout << s << endl;
	}

    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
	int tc;
	char str[1011];
	
	cin >> tc;
	while(tc--) {
		scanf(" %[^\n]", str);
		string s(str);
		int len = s.size();
		for(int i = 0; i < len; i++) {
			int pos = s.find("Hoshino");
			int lastPos = s.find(pos+2, 'o');
			if(pos != -1 && lastPos != len - 1)
				s.replace(pos, 7, "Hoshina");
			else if(pos != -1)
				s.replace(pos, 6, "Hoshina");
		}
		cout << s <<endl;
	}

	return 0;
}

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

const string src = "Hoshino";
bool check(string str,int n,int m){
    if(str[n]==src[m]){
        if(m==6) return true;
        return check(str,n+1,m+1);
    }
        return false;
}
int main(){
    int n;
    scanf("%d",&n);
    string *str=new string[n];
    for(int i=0;i<n+1;i++){
        getline(cin,str[i]);
        for(int j=0;j<str[i].size();j++){
            if(check(str[i],j,0)){
                str[i][j+6]='a';
                j+=5;
            }
        }
    }
    for(int i=0;i<n+1;i++){
        cout << str[i];
        if(i) cout << endl;
    }
}

C++: #include<cstdio>
#include<iostream>
#include<string>
  
using namespace std;
  
int main(void){
  
    int n;
    string bun;
    char inp;
  
    cin>>n;
    getchar();
    for(int i=0;i<n;i++){
        bun=("");
       while(1){
           inp=getchar();
           if(inp=='\n') break;
           bun+=inp;
       }
       for(int cnt=6;cnt<=bun.length()-1;cnt++){
           if(bun[cnt]=='o'&&bun[cnt-1]=='n'&&bun[cnt-2]=='i'&&bun[cnt-3]=='h'&&bun[cnt-4]=='s'&&bun[cnt-5]=='o'&&bun[cnt-6]=='H') bun[cnt]='a';
       }
       cout<<bun<<endl;
    }
  
    return 0;
}

C++: #include <cstdio>
#include <cstring>

int main(void)
{
	int N;
	
	while(scanf("%d", &N), N){
		fflush(stdin);
		while(--N, N>=0){
			char instr[1001];
			char *t;
	
			gets(instr);
			while( (t = strstr(instr, "Hoshino")) != NULL){
				t += 6;
				*t = 'a';
			}
	
			printf("%s\n", instr);
		}
		break;
	}
	

	return 0;
}

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

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

using namespace std;

int main()
{
	int n, p;
	string s;
	cin >> n;
	cin.get();
	while(n--) {
		getline(cin, s);
		while(p = s.find("Hoshino"), p != string::npos) {
			s.replace(p, 7, "Hoshina");
		}
		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"),index+=7;

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

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

int main(void)
{
	int n;
	string str;
	cin >> n;
	getline(cin, str);
	while (n--)
	{
		getline(cin, str);
		while (str.find("Hoshino") != -1)
		{
			int x = str.find("Hoshino");
			str.replace(x,7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(itr,c) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
/*
vector<string> split(string& s, char x){ // O(s.length())
  int i;
  vector<string> res(1);

  int word = 0;
  rep(i,s.size()){
    if(s[i] != x) res[word].push_back(s[i]);
    else if(i != 0 && i != s.size()-1){
      word++;
      res.push_back("");
    }
  }

  return res;
}
*/
int main(){
  int i,j,N;

  scanf("%d\n",&N);
  rep(i,N){
    string in;
    getline(cin,in);
/*
    vector<string> sp = split(in,' ');
    rep(j,sp.size()){
      if(sp[j] == "Hoshino") sp[j] = "Hoshina";
      if(sp[j] == "Hoshino.") sp[j] = "Hoshina.";
      cout << sp[j];
      if(j != sp.size()-1) cout << ' '; else cout << endl;
    }
  */
    int found = -1;
    while((found = in.find("Hoshino")) != -1) in[found + 6] = 'a';
    cout << in << endl;
  }

  return 0;
}

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

int main()
{
	int n;
	char *p;
	char str[1000];
	scanf("%d\n",&n);
	while(n--){
	gets(str);
	for(p;p=strstr(str,"Hoshino");)p[6]='a';
	puts(str);
	}
	return 0;
}

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

int main(void)
{
	int n, i;
	char a[1000][1000] = {0};
	char *p;

	scanf("%d\n", &n);
	
	for (i = 0; i < n; i++)
	{
		gets(a[i]);
	    p = strstr(a[i], "Hoshino");
		if (p != NULL)
			p[6] = 'a';
		puts(a[i]);
	}

	return 0;
}

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



int main(){
	std::string str;
	int data_num;
	std::cin >> data_num;
	std::cin.ignore();
	for(int i = 0; i < data_num; ++i){
		u_int loc = 0;
		u_int size;
		getline(std::cin, str);
		size = str.size();
		while(1){
			loc = str.find("Hoshino", loc);
			if(loc == std::string::npos || loc == size){
				break;
			}
			str[loc+6] = 'a';
			++loc;	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	char ho[8]={'H','o','s','h','i','n','o'};
	int n;
	string s;
	cin>>n;cin.ignore();
	while(n--){
		getline(cin,s);
		rep(i,s.size()-6){
//			cout<<i<<endl;
			bool f=true;
			rep(j,7){
				if(s[i+j]!=ho[j]){
					f=false;break;
				}
			}
			if(f){
				s[i+1]='a';
			}
		}
		cout<<s<<endl;
	}
}

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=sent.find(bef);
    if(num!=-1)
    sent.replace(num,bef.size(),aft);
    std::cout << sent << std::endl;
  }
    return 0; 
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	std::string str;
	
	int N;

	std::cin >> N;

	for(int i = 0; i < N; ++i){
		
		std::cin >> str
		std::string::size_type pos = str.find("Hoshino");
		
		while(pos != std::string::nops){
			 str.replace(pos, find_word.length(), correct_word);
			 pos = str.find(find_word, pos + find_word.length());
		}
	
	std::cout << str << std::endl;
	}
	return 0;
}