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 <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<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int n;
	char s[1001];
	char *p;
	scanf("%d",&n);gets(s);
	rep(i,n){
		gets(s);
		p=strstr(s,"Hoshino");
		if(p!=NULL)p[6]='a';
		puts(s);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int n;
	string s;
	string d="Hoshina";
	cin>>n;
	getline(cin,s);
	while(n--){
		getline(cin,s);
		while(1){
			unsigned int loc = s.find("Hoshino");
			if(loc!=string::npos)
			s.replace(loc,d.size(),d);
			else
				break;
		}
		cout<<s<<endl;
	}
	
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  int n=3;

  cin>>n;
  cin.ignore();
  rep(i,n){
    string s;
    getline(cin,s);
   if(s.size()<7)continue;
    rep(i,s.size()-6)if(s.substr(i,7)=="Hoshino")s.replace(i,7,"Hoshina");
    cout<<s<<endl;
  }


}

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<(int)s.size()-6;j++){
      string hos = s.substr(j,7);
      if(hos == "Hoshino"){
	s[j+6] = 'a';
      }
    }
    cout << s << endl;
  }
}

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

using namespace std;
int main(){
	int n , i , j , k ,x ;
	string str;
	cin >> n ;
	i=1;
	while( getline( cin , str ) ){
		x = str.find("hoshino");
		if ( x!=-1 ){
			cout << x << endl;
			str = str.replace( x , x+1 , "hoshina" );
			cout << str << endl;
	    }
	    else 
	    	cout <<"NA" << endl;
	    i ++ ;
	    if( i==n ) break;
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
#define rep(j,n) for(int j = 0 ; j < 7 ; j++)

int main(){
    string str;
    int n;
    
    cin >> n;
    for(int k = 0 ; k <= n ; k++){
        getline(cin,str);
        for(int i = 0 ; i < str.length() ; i++){
            string key = str.substr(i,7),repl;
            if(key == "Hoshino"){
                repl = "Hoshina";
                rep(j,n) str[i+j] = repl[j];
            }
        }
        cout << str << endl;
    }

    return 0;
}

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

int main(){
	string str;
	int n;
	cin >> n;
	getline(cin, str);
	for (int i = 0; i < n; i++) {
		getline(cin, str);
		for (int j = 0; j < int(str.size()) - 6; j++) {
			if (str.substr(j, 6) == "Hoshino")str.replace(j, 7, "Hoshina");
		}
		cout << str << endl;
	}
}

C++: #include<stdio.h>
#include<string.h>
char a[1050]={0};
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        fflush(stdin);
        scanf("%[^\n]",a);
        fflush(stdin);
        for(j=0;j<1010;j++)
        {
            if(a[j]=='H'&&a[j+1]=='o'&&a[j+2]=='s'&&a[j+3]=='h'&&a[j+4]=='i'&&a[j+5]=='n'&&a[j+6]=='o')
            {
                a[j+6]='a';
            }
        }
        printf("%s\n",a);
        for(int i=0;i<1050;i++)a[i]=0;
    }
    return 0;
}

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

int main(){
	int n;
	string line;
	scanf("%d ",&n);
	
	for(int x=0;x<n;x++){
		getline(cin,line);
		while (line.find("Hoshino") != string::npos) {
			line.replace(line.find("Hoshino"), 7, "Hoshina");
		}
		cout << line << endl;
    }
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdio.h>
#include <string>
#include <stdlib.h>

using namespace std;

int main(void){
//	FILE* fp_in = freopen("data.txt", "r", stdin);

	int n;
	string s;
	getline(cin, s);
	n = atoi(s.c_str());

	for(int i = 0; i < n; i++) {
		string str;
		getline(cin, str);
		for(int j = 0; j + 6 < str.length(); j++) {
			string sub;
			sub = str.substr(j, 7);
			if( sub == "Hoshino" )
				str[j + 6] = 'a';

			
		}
		cout << str << endl;
	}
	
 
//	while (1){}
	return 0;
}

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

int main(){
    int n;
    string s;
    cin >> n;
    getline(cin, s);
    for(int i=0; i < n; i++){
        getline(cin, s);
        while(true){
            string::size_type index = s.find("Hoshino");
            if(index == string::npos) break;
            else s.replace(index, 7, "Hoshina");
        }
        cout << s << endl;
    }
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<sstream>
#include<map>
#include<algorithm>
using namespace std;

string change(string,int);

int main(){
   int n,i;
   int pl;
   string str,z;
   string::size_type ind;
   
   cin>>n;
   getline(cin,z);
   for(i=0;i<n;i++){
      getline(cin,str);
      
      ind=str.find("Hoshino");
      while(ind!=string::npos){
         pl = (int)str.find("Hoshino");
         str = change(str,pl);
         ind = str.find("Hoshino");
      }
      cout<<str<<endl;
   }
   return 0;
}

string change(string str,int pl){
   int i,l=0;
   string name = "Hoshina";
   
   for(i=pl;i<pl+7;i++){
      str[i]=name[l];
      l++;
   }
   return str;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int n, i, j, k, c, x;
	char s[1001], r[1001], t[8] = "Hoshino";
	cin >> n;
	cin.ignore(1024, '\n');
	for (i = 0; i < n; i++)
	{
		cin.getline(s, sizeof(s));
		c = 0;
		for (j = 0; j < strlen(s); j++)
		{
			r[c] = s[j];
			c++;
			if (s[j] == 'H')
			{
				for (k = j+1, x = 0; k < j+7; k++, c++)
				{
					if (s[k] == t[k-j])
					{
						if (k == j+6)
							r[c] = 'a';
						else
							r[c] = t[k-j];
						x++;
					}
					else
					{
						r[c] = s[k];
						break;
					}
				}
				j+=x;
			}
		}
		r[strlen(s)] = '\0';
		cout << r << endl;
	}
}

C++: #include <iostream>
#include <string>
int main(){
  std::string s;
  int n;
  std::cin>>n,std::cin.get();
  for(;n;n--){
    getline(std::cin,s);
    int pos=0;
    while(pos=s.find("Hoshino",pos),pos!=std::string::npos){
      s.replace(pos,7,"Hashino");
      pos+=7;
    }
    std::cout<<s<<std::endl;
  }
  return 0;
}