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 <iostream>
#include <string>
  
int main(){
    const std::string wrong_word("Hoshino");
    const std::string right_word("Hoshina");
	
    int num;
    std::cin >> num;
    std::cin.ignore(); // ignore next newline character
      
    for(int i = 0; i < num; ++i){
        std::string str;
        std::getline(std::cin, str);
		
        std::string::size_type pos = str.find(wrong_word);
        while(pos != std::string::npos){
            str.replace(pos, wrong_word.length(), right_word);
            pos = str.find(wrong_word);
        }
		
        std::cout << str << std::endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string a;
	int n;
	cin>>n;
	for(int i=0;i<=n;i++){
		getline(cin,a);
		int h=a.size();
		for(int j=0;j<=h-7;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';
		}
		if(i!=0)
		    cout<<a<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int n;
string s;

int main(){
	cin >> n;
	cin.ignore();
	while(n--){
		getline(cin, s);
		bool f = 0;
		for (int i = 6; i < s.size(); i++){
			string t = s.substr(i, 7);
			if (t == "Hoshino"){
				s[i + 6] = 'a';
			}
		}
		cout << s << endl;
	}
}

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

int main()
{
    int n;
    cin>>n;
    n += 1;
    while(n!=0){
        string str;
        getline(cin,str);
        for(int i=0;i<str.length();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';
                i += 6;
            }
        }
        cout<<str<<endl;
        n--;
    }
    return 0;
}

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

int main(void) {
  int n;
  std::string str;
  std::string::size_type id;
  
  std::cin >> n;
  std::cin.ignore();
  for(int i=0; i<n; i++) {
    getline(std::cin, str);
    while((id = str.find("Hoshino")) != std::string::npos) {
        str[id+6] = 'a';
    }
    std::cout << str << std::endl;
  }
  return 0;
}

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

int main(){
    int n;

    cin>>n;
    cin.ignore();

    while(n--){
        string str;
        getline(cin,str);

        for(int i=0;i+6<str.length();i++){
            if(str.substr(i,7)=="Hoshino"){
                str.replace(i,7,"Hoshina");
            }
        }

        cout<<str<<endl;
    }

    return 0;
}

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

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

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int i,j,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char a[1050]={0};
        fflush(stdin);
        scanf("%[^\n]",a);
        fflush(stdin);
        int len = 0;
        for(j = 0; a[j] != 0; j++) len++;
        for(j=0;j<len;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(j = 0; j < 1050; j++)a[j]=0;
        fflush(stdin);
    }
    return 0;
}

C++: n = gets
puts $_.gsub("Hoshiro", "Hoshina") while gets

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

int main(){
	string str;
	string hosino = "Hoshino";
	string hosina = "Hoshina";
	int n, index;
	cin>>n;cin.ignore();
	for(int i=0;i<n;i++){
		getline(cin,str);
		while((index = str.find(hosino.c_str(), 0)) != string::npos){
			str.erase(str.begin()+index, str.begin()+index+hosino.size());
			str.insert(index, hosina);
		}
		cout<<str<<endl;
	}
	
	return 0;
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;cin.ignore(2);

  string input;

  for(int i=0;i<line_length;++i){
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }

C++: #include <iostream>
#include <sstream>
#include <vector>
 
int main(void){
    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 line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

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

int main(void) {

  int n;
  char word[1200];

  char buf[1200];

  char* p;
  char c;
  int i;
  
  scanf("%d",&n);
  c=getchar();

  for(i=0;i<n;i++) {

    fgets(buf,sizeof(buf),stdin);

    buf[strlen(buf)-1]='\0';

    word[0]='\0';

    p=strtok(buf," ");
    if(strcmp(p,"Hoshino")==0) {
      strcat(word,"Hoshina");
    }
    else {
      strcat(word,p);
    }

    while((p=strtok(NULL," "))!=NULL) {
      if(strcmp(p,"Hoshino")==0) {
	strcat(word," Hoshina");
      }
      else {
	strcat(word," ");
	strcat(word,p);
      }
    }

    printf("%s\n",word);

  }

  return 0;

}