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 <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
	int n;
	cin>>n;
		string s;
		getline(cin,s);
	REP(i,n){
		getline(cin,s);
		int  p=0;
		while(1){
			p= s.find("Hoshino",p);
			if(p==s.npos){
				break;
			}
			p+=6;
			s[p]='a';
		}
		cout<<s<<endl;
	}
}

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

using namespace std;

int main()
{
	int n;
	string str;
	
	cin >> n;
	cin.ignore();
	while (n > 0){
		getline(cin, str);
		int len = 0;
		while (1){
			len = str.find("Hoshino", len);
			if (len == -1)  break;
			str[len + 6] = 'a';
		}
		cout << str << endl;
		n--;
	}
	return (0);
}

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

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        std::string text;
        getline(std::cin, text);
        
        std::string::size_type index = 0;
        while((index = text.find(str_false, index)) != std::string::npos){
            text.replace(index, str_false.size(), str_true);
            index += str_true.size();
        }
        std::cout  << text << std::endl;
    }
    
    return 0;
}

C++: #include<stdio.h>
int main(){
    int i,j,n,flag=0,d;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        for(i=0;;i++){
      scanf("%c", &a[i]);
      if(a[i]=='\n'){
    a[i]='\0';
    d=i;
    break;
      }
    }

        for(i=0;i<d;i++){
            //printf("%d ",flag);
            if(flag==0){
                if(a[i]=='H')flag++;
            }
            else if(flag==1){
                if(a[i]=='o')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==2){
                if(a[i]=='s')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==3){
                if(a[i]=='h')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==4){
                if(a[i]=='i')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==5){
                if(a[i]=='n')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==6){
                if(a[i]=='o')a[i]='a';
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
        }
        for(i=0;i<d;i++)printf("%c",a[i]);//puts("");
        for(i=0;i<10000;i++)a[i]=0;
    }
    return 0;
}

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

int main(){
    std::string buf;
    int n;

    std::cin >> n;
    // now, there is "\n ...." in the stream.
    // then, skip the initial '\n'.
    std::getline(std::cin,buf);

    for (int i=0;i < n;++i) {
        std::getline(std::cin,buf);
        std::stringstream ss(buf);

        // replace the first word in the text.
        ss >> buf;
            if (buf == "Hoshino") {
                std::cout << "Hoshina";
            }
            else if (buf == "Hoshino,") {
                std::cout << "Hoshina, ";
            }
            else if (buf == "Hoshino.") {
                std::cout << "Hoshina. ";
            }
            else if (buf == "Hoshino's") {
                           std::cout << "Hoshina's ";
                       }
            else{
                std::cout << buf;
            }

       // replace the follow-on words with' '.
        while (ss >> buf) {
            if (buf == "Hoshino") {
                std::cout << " Hoshina";
            }
            else if (buf == "Hoshino,") {
                std::cout << " Hoshina,";
            }
            else if (buf == "Hoshino.") {
                std::cout << " Hoshina.";
            }
            else if (buf == "Hoshino's") {
                std::cout << " Hoshina's ";
            }
            else{
                std::cout << " " << buf;
            }
        }
        std::cout << std::endl;
    }

    return 0;
}

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;
  cin>>n;
  cin.ignore();
  rep(j,n){
    string s;
    getline(cin,s);
   if(s.size()<7)continue;
   size_t n;
   while(n=s.find("Hoshino"),n!=string::npos)s[n+6]='a';
   //rep(i,s.size()-6)if(s.substr(i,7)=="Hoshino")s.replace(i,7,"Hoshina");
    cout<<s<<endl;
  }


}

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

int main(){
	int n, j;
	cin >> n;
	getchar();
	char s[1001];
	for (int i = 0; i < n; i++) {
		//string s;
		//cin >> s;
		if (scanf("%1000[^\n]%*[^\n]", s) < 1) *s = '\0';
		getchar();
		for (j = 0; j < 1000-6; j++) {
			if (s[j + 6] == 0)
				break;
			if (s[j] == 'H'&&s[j + 1] == 'o'&&s[j + 2] == 's'&&s[j + 3] == 'h'&&s[j + 4] == 'i'&&s[j + 5] == 'n'&&s[j + 6] == 'o')
				s[j + 6] = 'a';
		}
		cout << s << endl;
		for (j += 5; j >= 0; j--) {
			s[j] = 0;
		}
	}
	

}

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

using namespace std;

int main(void){
	std::ios_base::sync_with_stdio(false);

	int n,cnt;
	string inp,bun;

	cin>>n;
	getchar();
	for(int i=0;i<n;i++){
		bun=("");
		cnt=0;
		while(1){
			inp=getchar();
			if(inp=="\n") break;
			bun+=inp;
			if(cnt>=6){
				if(bun[cnt]=='o'&&bun[cnt-1]=='n'&&bun[cnt-2]=='i'&&bun[cnt-3]=='h'&&bun[cnt-4]=='s'&&bun[cnt-5]=='o'&&bun[cnt-6]=='H') bun[cnt]='a';
			}
			cnt++;
		}
		cout<<bun<<endl;
	}

	return 0;
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;
  string str;
  getline(cin, str);

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

C++: n = int(input())
for _ in range(n):
  s = input()
  print(s.replace('Hoshino', 'Hoshina'))