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> 

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 str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::string text;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        getline(std::cin, text);
        u_int index =  0;
        
        while((index = text.find(str_false, index)) != std::string::npos)
            text.replace(index, str_false.size(), str_true);
        std::cout  << text << std::endl;
    }
    
    return 0;
}

C++: #include<stdio.h>

int main()
{
	int n,i,j=0,k;
	char str[1008],temp;
	
	scanf("%d",&n);
	temp=getchar();
	for(i=0;i<n;i++){
		for(j=0;;j++){
			str[j] = getchar();
			if(str[j] == '\n'){
				str[j] = '\0';
				break;
			}
		}
		
		for(k=0;k<j;k++){
			if((str[k]=='H' && str[k+1]=='o' && str[k+2]=='s' && str[k+3]=='h' && str[k+4]=='i' && str[k+5]=='n' && str[k+6]=='o') && (str[k+7]=='\0' || str[k+7]==' ' || str[k+7]=='.'))str[k+6]='a';
		}
		printf("%s\n",str);
	}
	
	return 0;
}

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

int main(){
    int n;
    cin>>n;
    while(n-->=0){
        string s;
        getline(cin,s);
        for(int i=6;i<s.length();i++)
            if(s[i]=='o'&&s[i-1]=='n'&&s[i-2]=='i'&&s[i-3]=='h'&&s[i-4]=='s'&&s[i-5]=='o'&&s[i-6]=='H')
                s[i]='a',s[i-1]='n',s[i-2]='i',s[i-3]='h',s[i-4]='s',s[i-5]='o',s[i-6]='H';
        cout<<s<<endl;
    }
}

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

int main(){
  int n;
  string s;

  scanf("%d\n", &n);
  while(n--){
    getline(cin, s);
    vector<string> ans;
    stringstream ss(s);
    string t;
    while(getline(ss, t, ' ')){
      int i=0;
      while((i=t.find("Hoshino", i))!=string::npos){
        t.replace(i, 7, "Hoshina");
      }
      ans.push_back(t);
    }
    for(int i=0; i<ans.size(); i++){
      if(i!=ans.size()-1)cout<<ans[i]<<' ';
      else cout<<ans[i]<<endl;
    }
  }
  return 0;
}

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

int main(){
  int n;
  string s;

  scanf("%d\n", &n);
  while(n--){
    getline(cin, s);
    vector<string> ans;
    stringstream ss(s);
    string t;
    while(getline(ss, t, ' ')){
      int i;
      if((i=t.find("Hoshino", 0))!=string::npos){
        t.replace(i, 7, "Hoshina");
      }
      ans.push_back(t);
    }
    for(int i=0; i<ans.size(); i++){
      if(i!=ans.size()-1)cout<<ans[i]<<' ';
      else cout<<ans[i]<<endl;
    }
  }
  return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int main()
 {
   int n;
   cin>>n;
   while(n--)
   {
     string s;
     getline(cin,s);
     while(s.find("Hoshino")!=string::npos)
     {
       s.replace(s.find("Hoshino"),7,"Hoshina");                                      
     }          
     cout<<s<<endl;
   }
   //while(1);
   return 0;
 }

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

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int n;

	scanf("%d\n", &n);
	loop(i, 0, n)
	{
		string line;
		std::getline(cin, line);
		int pos = 0;

		while( (pos = line.find("Hoshino", pos)) != string::npos )
		{
			line.replace(pos, 7, "Hoshina");
		}
		cout << line << endl;
	}
	return (0);
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }



int n;
string str;

int main() {
    scanf("%d\n", &n);
    for (int id = 0; id < n; ++id) {
        getline(cin, str);
        for (int i = 0; i < (int)str.size()-6; ++i) {
            string sub = str.substr(i, 7);
            if (sub == "Hoshino") { str[i+6] = 'a'; }
        }
        puts(str.c_str());
    }
    return 0;
}

C++: #include<stdio.h>
int main(){
    int i,j,n,flag=0,d;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        for(i=0;;i++){
      scanf("%c", &a[i]);
      if(a[i]=='\n'){
    a[i]='\0';
    
    break;
      }
    }

        for(i=0;a[i]!=0;i++){
            //printf("%d ",flag);
            if(flag==0){
                if(a[i]=='H')flag++;
            }
            else if(flag==1){
                if(a[i]=='o')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==2){
                if(a[i]=='s')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==3){
                if(a[i]=='h')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==4){
                if(a[i]=='i')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==5){
                if(a[i]=='n')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==6){
                if(a[i]=='o')a[i]='a';
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
        }
        for(i=0;a[i]!=0;i++)printf("%c",a[i]);puts("");
        for(i=0;a[i]!=0;i++)a[i]=0;
    }
    return 0;
}