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 <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;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <cmath>

#define int64 long long int

using namespace std;
typedef pair<int, int> P;

int main()
{
    int n, len;
    char str[1000];
    cin >> n;
    for(int i=0; i<n; i++){
        gets(str);
        len = strlen(str);
        if(len < 7) cout << str << endl;
        else {
            for(int j=0; j<=len-7; j++){
                if(str[j] != 'H') continue;
                if(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';
                }
            }
            puts(str);
        }
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
string a, b;
int n;
int main(){
	b = "Hoshina";
	cin >> n;
	for(int i = 1; i <= n+1; i++){
		getline(cin, a);
		if(a.find("Hoshino") != -1){
			a.insert(a.find("Hoshino"), b);
			a.erase(a.find(b)+7, 7);
		}
		cout << a << endl;
	}
	return 0;
}