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 <vector>
#include <string>
#include <cstdio>

static void inputSentences(std::vector<std::string>& sentences, int n)
{
  fflush(stdin);
  for (int i = 0; i < n; i++) {
    std::string inputSentence;
    getline(std::cin, inputSentence);
    sentences.push_back(inputSentence);
  }
}

//static void convertSentencesCore(const std::string& targetBase,
//                                 const char afterConvert,
//                                 int convertPos,
//                                 std::vector<std::string>& sentences)
//{
//  for (std::vector<std::string>::iterator it = sentences.begin();
//    it != sentences.end();
//    ++it) {
//    /* ?????¬ */
//    if (*it == targetBase) {
//      it->at(convertPos) = afterConvert;
//      continue;
//    }
//    if (it->size() <= targetBase.size()) {
//      continue;
//    }
//    while(true) {
//      int find;
//      std::string targetStr;
//      bool findFlg = false;
//      /* ?????? */
//      targetStr = " " + targetBase + " ";
//      find = it->find(targetStr);
//      if (find != std::string::npos) {
//        it->at(find + convertPos + 1) = afterConvert;
//        findFlg = true;
//      }
//      /* ?????? */
//      targetStr = targetBase + " ";
//      find = it->find(targetStr);
//      if (find == 0) {
//        it->at(convertPos) = afterConvert;
//        findFlg = true;
//      }
//      /* ????°? */
//      targetStr = " " + targetBase;
//      find = it->find(targetStr);
//      if (find == it->size() - targetBase.size() - 1) {
//        it->at(find + convertPos + 1) = afterConvert;
//        findFlg = true;
//      }
//      if (findFlg == false) {
//        break;
//      }
//    }
//  }
//}
//
//static void convertSentences(std::vector<std::string>& sentences)
//{
//  convertSentencesCore("Hoshino", 'a', 6, sentences);
//  convertSentencesCore("Hoshino,", 'a', 6, sentences);
//  convertSentencesCore("Hoshino.", 'a', 6, sentences);
//}

static void convertSentences(std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    while (true) {
      std::string::size_type find = it->find("Hoshino");
      if (find == std::string::npos) {
        break;
      }
      else {
        it->at(find + 6) = 'a';
      }
    }
  }
}

static void outputSentences(std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    std::cout << *it << std::endl;
  }
}

int main(void)
{
  int n;
  std::vector<std::string> sentences;

  std::cin >> n;

  inputSentences(sentences, n);
  convertSentences(sentences);
  outputSentences(sentences);

  return 0;
}

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

int main(){
	int n;
	string s;
	
	cin >> n;
	cin.ignore();
	for(int i=0 ; i<n  ; i++){
		getline( cin , s );
		
		while( s.find("Hoshino",0) != string::npos){
			unsigned i = s.find("Hoshino",0);
			s.replace( i , 7 , "Hoshina" );
		}
		cout << s << endl;
	}
	
	return 0;
}

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

int main()
{
	int n;

	cin >> n;
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

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

using namespace std;

typedef unsigned long long ull;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

int main(){
    int n; cin>>n;
    cin.ignore();
    while(n--){
        string s; getline(cin,s);
        size_t beg;
        while(beg=s.find("Hoshino"), beg!=string::npos){
            s[beg+6]='a';
        }
        cout<<s<<endl;
    }
}

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

int main(){
	int n;
	string str;
	cin >> n;
	getline(cin, str);
	for(int i = 0;i < n;i++){
		getline(cin, str);
		while(str.find("Hoshino") != -1){
			int locate = str.find("Hoshino");
			str[locate + 6] = 'a';
		}
		cout << str << endl;
	}
}

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

int main(){
	string x;
	int pos;
	int n;
	cin >> n;
	cin.ignore();
	while (n--){
			getline(cin, x);
		while ((pos=x.find("Hoshino"))!= string::npos){
			x.replace(pos, 7, "Hoshina");
		}
		cout << x << 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;
    }
  }

  return 0;
}

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

int main(){
	int data;
	std::cin >> data;  //dataset
	std::cin.ignore();
	
	std::string mis = "Hoshino";
	std::string correct = "Hoshina";
	
	for(int i=0; i<data; ++i){
		std::string  sentence;
		std::getline(std::cin, sentence);
		
		std::string::size_type index = sentence.find(mis);
		
		if(index == std::string::npos){  // Hoshino??
			std::cout << sentence << std::endl; 
		}else{
			while(index != std::string::npos){  // Hoshino???
				sentence.replace(index, mis.length(), correct);
				index = sentence.find(mis, index + correct.length());
			}
			std::cout << sentence << std::endl;
		}
	}
	
	return 0;
}

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

int main(){
	long long int n;
	char* a;
	char letter[1000];
	while(cin >> n){
		for(int i=0 ; i<n ; i++){
			cin >> letter;
		}
		do {
			a=strstr(letter , "Hoshino");
			if (a==NULL) break;
			strncpy(a , "Hoshina" , 7);
			
		} while (a!='\0');
		cout << letter << endl;
		n--;
		if (!n) break;
	}
	return 0;
}

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

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    //std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i <= line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}