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 <algorithm>
#include <vector>
using namespace std;

void Hoshina(string& str){
	if(str.size() < 7){
	} else {
		for(unsigned int i=0; i<str.size()-6; ++i){
			if(str[i] == 'H' && str[i+1] == 'o' && str[i+2] == 's' && str[i+3] == 'h' && str[i+4] == 'i' && str[i+5] == 'n' && str[i+6] == 'o'){
				str[i+6] = 'a';
			}
		}
	}
	cout << str << endl;
}

int main() {
	int n;
	string str;
	cin >> n;
	cin.ignore();
	for(int i=0; i<n; ++i){
		getline(cin,str);
		Hoshina(str);
		cin.ignore();
	}
	return 0;
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

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

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

int main(void)
{
    string str;
    int n;
    
    scanf("%d\n", &n);
    for (int i = 0; i < n; i++){
        getline(cin,str);
        for (int j = 0; j < str.size(); j++){
            if (str[j] == 'H'){
                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';
                    j += 6;
                }
            }
        }
        printf("%s\n", str.c_str());
    }
    
    return (0);
}

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

int main() {
  string str,line;
  int n,k=0;
  char *words[1000];
  cin >> n;
  getline(cin,line);
  for(int i=0;i<n;i++) {
    getline(cin,line);
    stringstream ss(line);

    while(ss >> str) {
      k++;
    }
    ss.str("");
    ss.clear(stringstream::goodbit);
    stringstream xx(line);
    for(int i=0;i<k-1;i++) {
      xx >> str;
      if(str == "Hoshino")
        cout << "Hoshina" << " ";
      else
        cout << str << " ";
    }
    xx >> str;
    if(str == "Hoshino")
      cout << "Hoshina" << endl;
    /*
    else if(str == "Hoshino.")
      cout << "Hoshina." << endl;
    */
    else
      cout << str << endl;
    k=0;
  }
}

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

int main(void){
  char sentence[1050];
  int n;
  scanf("%d\n",&n);
  for(int i=0;i<n;i++){
        for(int j=0;j<1050;j++){
            sentence[j]=getchar();
            if(sentence[j]=='\n'){
                sentence[j]=0;
                break;
            }
        }
    for(int j=0;j<1025;j++){
        if(sentence[j]==0)break;
        if(!strncmp(sentence+j,"Hoshino",7)){
            sentence[j+6]='a';
        }
    }
    puts(sentence);
  }
  return 0;
    
}

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

int main() {
  string str,line;
  int n,k=0;
  char *words[1000];
  cin >> n;
  getline(cin,line);
  for(int i=0;i<n;i++) {
    getline(cin,line);
    stringstream ss(line);

    while(ss >> str) {
      k++;
    }
    ss.str("");
    ss.clear(stringstream::goodbit);
    stringstream xx(line);
    for(int i=0;i<k-1;i++) {
      xx >> str;
      if(str == "Hoshino")
        cout << "Hoshina" << " ";
      else
        cout << str << " ";
    }
    xx >> str;
    if(str == "Hoshino")
      cout << "Hoshina" << endl;
    else if(str == "Hoshino.")
      cout << "Hoshina." << endl;
    else
      cout << str << endl;
    k=0;
  }
}

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

int main(void)
{
    char str[1005];
    int n;
    
    scanf("%d\n", &n);
    for (int i = 0; i < n; i++){
        scanf("%[^\n]", str);
        int l = (int)strlen(str);
        for (int j = 0; j < l; j++){
            if (str[j] == 'H'){
                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';
                    j += 6;
                }
            }
        }
        printf("%s\n", str);
    }
    
    return (0);
}

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

void Hoshina(string& str){
	for(unsigned int i=0; i<str.size()-6; ++i){
		if(str[i] == 'H' && str[i+1] == 'o' && str[i+2] == 's' && str[i+3] == 'h' && str[i+4] == 'i' && str[i+5] == 'n' && str[i+6] == 'o'){
			str[i+6] = 'a';
		}
	}
	cout << str << endl;
}

int main() {
	int n;
	string str;
	cin >> n;
	cin.ignore();
	for(int i=0; i<n; ++i){
		getline(cin,str);
		Hoshina(str);
		cin.ignore();
	}
	return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		string str[1000];
		char a;
		int c=0;
		cin>>str[c];
		scanf("%c",&a);
		c++;
		while(a!='\n'){
			cin>>str[c];
			scanf("%c",&a);
			c++;
		}
		for(int i2=0;i2<c-1;i2++){
			if(str[i2]=="Hoshino")
				printf("Hoshina ");
			else
				printf("%s ",str[i2].c_str());
		}
		if(str[c-1]=="Hoshino")
			printf("Hoshina\n");
		else
			printf("%s\n",str[c-1].c_str());
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	bool flg = false;
	int n, i, c;
	string w, s;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		c = 0;
		s = "";
		while (1)
		{
			w = "";
			cin >> w;
			if (w.compare("Hoshino") == 0)	s += "Hoshina";
			else							s += w;
			if (cin.get() == '\n') break;
			s += " ";
		}
		s.erase(s.end(), s.end());
		cout << s << endl;
	}
	return 0;
}

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

int main(void){
  string sen;
  int n;
  cin >> n;
  cin.ignore();
  for(int i = 0; i < n; i++){
    getline(cin, sen);
    int k = 0;
    while(true){
      k = sen.find("Hoshino", k);
      if(k < 0) break;
      sen[k+6] = 'a';
      k++;
    }
    cout << sen << 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;
    int j;
	for( 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)cout << endl;
	}
	if(j == false)
		cout << endl;  
	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();

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

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

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				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){
        	std::cout << *it << " ";
        }
        std::cout << std::endl;
	}

	return 0;
}