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

const string src = "Hoshino";
bool check(string str,int n,int m){
    if(str[n]==src[m]){
        if(m==6) return true;
        return check(str,n+1,m+1);
    }
        return false;
}
int main(){
    int n;
    cin >> n;
    cin.ignore();
    string *str=new string[n];
    for(int i=0;i<n;i++){
        getline(cin,str[i]);
        for(int j=0;j<str[i].size();j++){
            if(check(str[i],j,0)){
                str[i][j+6]='a';
                j+=5;
            }
        }
    }
    for(int i=0;i<n;i++){
        cout << str[i] << endl;
    }
    return 0;
}

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


int n;
std::string str;


std::string substg(int a, int b) {
	std::string res = "";
	for (int i = a; i < a + b; i++) {
		res += str[i];
	}

	return res;
}

void replace(int a) {
	std::string hoge = "Hoshina";

	for (int i = a; i < a + 7; i++) {
		str[i] = hoge[i - a];
	}
}

void solve() {
	int i = 0;
	while (i <= (signed)(str.size() - 7)) {
		if (substg(i, 7) == "Hoshino") {
			replace(i);
			i += 7;

			continue;
		}

		i++;
	}

	std::cout << str << std::endl;
}




int main() {
	std::cin >> n;

	for (; n >= 0; n--) {
		std::getline(std::cin, str);

		solve();
	}

	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);
  while(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>
using namespace std;
int main()
{
	int n; cin >> n ; cin.ignore();
	for(int i=0;i<n;i++){
		string full_str; getline(cin,full_str);
		string::iterator p;
		for(p=full_str.begin(); p!=full_str.end();p++)
		{
			int m=p - full_str.begin();
			string pre_str=full_str.substr(m,7);
			if(pre_str=="Hoshino") full_str.replace(p,p+7,"Hoshina");
		};
		cout << full_str << endl;
	};
}

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::cin.ignore();

    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 <string>

using namespace std;

void solve()
{
	int n;
	cin >> n;
	while(n--)
	{
		string str;
		getline(cin, str);
		for(int i = 0; i < str.size(); ++i)
		{
			if(str[i] == 'H' && i + 6 < str.size() && 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()
{
	solve();
	return(0);
}

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

int main()
{
  string s;
  getline(cin, s);
  while (getline(cin, s)) {
    string::size_type b = 0, e;
    do {
      e = s.find("Hoshino", b);
      if (e != string::npos) {
	s[e+6] = 'a';
      }
      b = e + 1;
    } while (e != string::npos);
    cout << s << endl;
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

bool is_change(string str,char* tmp,int pos, int len){
	const char A[] = {'H','o','s','h','i','n','a'};
	if(str.substr(pos,len) == "Hoshino"){
		for(int i=pos,j=0;i<pos+len,j<7;i++,j++){
			tmp[i] = A[j];
		}
		return true;
	}

	return false;
}

int main(){

	string str;
	while(getline(cin,str)){
		int n;
		sscanf(str.c_str(),"%d",&n);
		for(int i=0;i<n;i++){
			getline(cin,str);
			char tmp[1024];
			strcpy(tmp,str.c_str());
			for(int i=0;i+6<str.size();i++){
				if(is_change(str,tmp,i,7)) i+=7;
			}

			cout << tmp << endl;
		}
	}
}

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-7;i++){
			string sb=s.substr(i,7);
			if(sb=="Hoshino"){
				s.replace(i,i+7,"Hoshina");
				}
			}
		}
			cout<<s<<endl;
		}
	
		return 0;
	}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string str;vector<string> vs;
    vs.clear();
    while(cin>>str){
      if(str=="Hoshino"){
	vs.push_back("Hoshina");
      }else
	vs.push_back(str);
    }
    for(int j=0;j<vs.size();j++){
      cout<<vs[j];
      if(j!=vs.size()-1)
	cout<<" ";
    }
  }
  return 0;
}

C++: 
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii; 
typedef long long ll ;

#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()


int main(void){
	int n;	
	cin>>n;
	rep(j,n){
		string s;
		cin>>s;
		rep(i,s.size()-6){
			if(s[i]=='H'&&s[i+1]=='o'&&s[i+2]=='s'&&s[i+3]=='h'&&s[i+4]=='i'&&s[i+5]=='n'&&s[i+6]=='o'){
				s[i+6]='a';
			}
			
		}
	cout<<s<<endl;
	}
}

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

using namespace std;

int main(){
  int num;
  char c;
  cin >> num;
  scanf("%c",&c);
  for(int i = 0; i < num; i++){
    string str;
    while(1){
      scanf("%c",&c);
      if(c == '\n'){
	if(str != "Hoshino")cout << str << endl;
	else cout << "Hoshina" <<  endl;
	break;
      }
      if(c == ' '){
	if(str != "Hoshino")cout << str << " ";
	else cout << "Hoshina ";
	str = "";
	continue;
      }
      str += c;
    }

  }
  return 0;
}

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

using namespace std;

int main()
{
	string str;
	int n,i,j;
	
	cin >> n;
	
	for(i=0;i<=n;i++)
	{
		getline(cin,str);
		
		if(i!=0)
		{
			for(;;)
			{
				if(str.find("Hoshino")<str.size())
					str[str.find("Hoshino")+6]='a';
				else
					break;
			}
			cout << str << endl;
		}
	}
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int n;
	char s[1001];
	char *p;
	scanf("%d",&n);
	rep(i,n){
		gets(s);
		p=strstr(s,"Hoshino");
		if(p!=NULL)p[6]='a';
		puts(s);
	}
	return 0;
}