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 <sstream>
#include <vector>

int main(void){
	std::string tmp;
	u_int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore(); //delete cin buffer

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;
		std::string line; //outputted line data 

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}else if(tmo == "Hoshino."){
				tmp = "Hoshina.";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	if(it == (str.end() - 1)){
           		line = line + *it + "\0" ;
        	}else{
        		line = line + *it + " ";
        	}
        }
        std::cout << line << std::endl;
	}

	return 0;
}

C++: //#include <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
	for(int j = 0; j<= n; j++)
	{
	
		char s[MAX_SIZE];
		gets(s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hoshina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}
		if(j != 0) cout << endl;
	}
	return 0;

}

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

int main(void)
{
  char x[1010];
  int n;
  int i;
  int a;

  scanf("%d", &n);

  for(i=0; i<n; i++){
    fgets(x, 1010, stdin);

    for(a=0; x[a]!='\n'; a++){
      if(x[a]=='H' && x[a+1]=='o' && x[a+2]=='s' && x[a+3]=='h' && x[a+4]=='i' && x[a+5]=='n' && x[a+6]=='o')
	x[a+6]='a';
    }

    for(a=0; x[a+1]!='\0'; a++){
      printf("%c", x[a]);
    }
    printf("\n");
  }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>

int main(void){
	std::string tmp;
	u_int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore(); //delete cin buffer

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;
		std::string line; //outputted line data 

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}else if(tmp == "Hoshino."){
				tmp = "Hoshina.";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	if(it == (str.end() - 1)){
           		line = line + *it + "\0" ;
        	}else{
        		line = line + *it + " ";
        	}
        }
        std::cout << line << std::endl;
	}

	return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	string a;
	string g = "Hoshino";

	while(cin >> n){
		cin.ignore();
		for (int i = 0; i < n; ++i){
			int x = 0;
			getline(cin, a);
			if ((x = a.find("Hoshino")) >= 0)
				a.replace(x, g.length(), "Hoshina");
			cout << a << endl;
		}
	}
	return 0;
}

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;
    if(i<gyou-1)
    std::cout << std::endl;
  }
  return 0; 
}

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

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

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

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;
	for(j=0;j<n;j++){
	 //??\????????????
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c==endl){
	   break;
	  }else{
	   switch(flg){
		case 0:
		if(c=='H'){flg++;}
		break;
		case 1:
		if(c=='o'){flg++;}else{flg=0;}
		break;
		case 2:
		if(c=='s'){flg++;}else{flg=0;}
		break;
		case 3:
		if(c=='h'){flg++;}else{flg=0;}
		break;
		case 4:
		if(c=='i'){flg++;}else{flg=0;}
		break;
		case 5:
		if(c=='n'){flg++;}else{flg=0;}
		break;
		case 6:
		if(c=='o'){c='a';}
		flg=0;
		break;
	   }
	   cout<<c;
	  }
	 }
	 cout<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
    int n;
    char a[1000],c;
    scanf("%d",&n);
    while(scanf("%s",a)!=EOF){
        if(a[0]=='H'&&a[1]=='o'&&a[2]=='s'&&a[3]=='h'&&a[4]=='i'&&a[5]=='n'&&a[6]=='o')printf("Hoshina");
        else printf("%s",a);
        scanf("%c",&c);
        printf("%c",c);
    }
}

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

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

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    std::cin >> data_set_num;
    //std::getline(std::cin,str);
    //sscanf(str.c_str(),"%d ",&data_set_num);

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int n;
  cin>>n;
  string str;
  getline(cin,str);
  rep(j,n){
    getline(cin,str);
    rep(i,str.size() - 6){
      if(str.substr(i,7) == "Hoshino")str[i+6] = 'a';
    }
    cout<<str<<endl;
  }
}

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

#define N 1000

using namespace std;

int main()
{
	int n;
	int s;
	string str;

	cin >> n;
	cin.ignore();

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

		for(s = 0; s < N; s++){

		if(str[s] == 'H' && str[s+1] =='o' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o' 
			|| str[s] == 'H' && str[s+1] =='a' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o'){
				
				str[s] = 'H';
				str[s+1] = 'o';
				str[s+2] = 's';
				str[s+3] = 'h';
				str[s+4] = 'i';
				str[s+5] = 'n';
				str[s+6] = 'a';
			}

		}
		cout << str << endl;

	}
}