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>
 
int main(void){
    std::string str;
    int N;
    std::cin >> N;
    std::cin.ignore();
    for(int i = 0; i < N; ++i){
        getline(std::cin, str);
        int pos;
        while((pos = str.find("Hoshino")) != -1){
            str.replace(pos, 7, "Hoshina");
        }
        std::cout << str << std::endl;
    }
}

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

using namespace std;

bool is_same(char *str1, char *str2) {
	while (1) {
		if (*str1 != *str2) return false;
		if (*str1 || *str2)
			++str1, ++str2;
		else
			return true;
	}
}

int main() {
	int n, count = 0;
	scanf("%d\n", &n);

	char str[1001];
	char str2[] = "Hoshino";
	while (scanf("%s", str) != EOF) {
		bool period = false;
		for (int i = 0; str[i]; ++i)
			if (str[i] == '.') str[i] = '\0', period = true;

		if ( is_same(str, str2) ) printf("Hoshina");
		else printf("%s", str);

		if (period) printf(".");

		char c = getchar(); if (c == 13) c = '\n';
		printf("%c", c);
		if (c == '\n' && ++count >= n) break;
	}
}

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

int main(void){
	std::string str;

	while(std::cin >> str){
		std::string::size_type index;

		for(index = str.find("Hoshino"); index != std::string::npos; index = str.find("Hoshino",index + 6)){
			str.replace(index,7,"Hoshina");
		}

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

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string str, judge = "";
	int n, count = -1;
	cin >> n;
	for (int i = 0; i < n; i++) {
		if (i == 0) { getline(cin, str); }
		getline(cin, str);
		for (int j = 0; j < str.size(); j++) {
			judge += str[j];
			//cout << judge << endl;
			if (str[j+1] == ' ' || j == str.size() - 1) {
				count++;
				if (judge == "Hoshino" && count == 0) {
					cout << "Hoshina";
				}
				else if (judge == "Hoshino." && count == 0) {
					cout << "Hoshina.";
				}
				else if (judge == " Hoshino" && count > 0) {
					cout << " Hoshina";
				}
				else if (judge == " Hoshino." && count > 0) {
					cout << " Hoshina.";
				}
				else {
					cout << judge;
				}
				judge = "";
			}
		}
		cout << endl;
		count = -1;
	}
	return 0;
}

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



int main(){
	std::string str;
	int data_num;
	std::cin >> data_num;
	std::cin.ignore();
	for(int i = 0; i < data_num; ++i){
		u_int loc = 0;
		u_int size;
		getline(std::cin, str);
		size = str.size();
		while(1){
			loc = str.find("Hoshino", loc);
			if(loc == std::string::npos || loc == size){
				break;
			}
			str[loc+6] = 'a';
			++loc;	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

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

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);
        size_t pos = 0; // index where we will start searching.
        
        while (true) {
            pos = buf.find("Hoshino",pos);
            if (pos == -1) {    // couldn't find.
                break;
            }else{
                buf.replace(pos,sizeof("Hoshino"),"Hoshina");
                pos += sizeof("Hoshina");
            }
        }
        std::cout << buf << std::endl;
    }
    
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int main()
{
	int n;
	cin >> n;
	cin.get();
	for(int i=0;i<n;i++)
	{
		string s;
		getline(cin,s);
		for(int j=6;j<s.size();j++)
		{
			if(s.substr(j-6,7)=="Hoshino")
			{
				s.at(j)='a';
			}
		}
		cout << s << endl;
	}
	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <climits>

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 FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,n-1)

const double EPS = 1e-10;
const double PI = acos(-1.0);

int main() {
	int n;
	string str;
	
	getline(cin, str, '\n');
	n = toInt(str);

	int pos;
	REP(i, n) {
		getline(cin, str, '\n');

		if((pos = str.find("Hoshino")) != string::npos) {
			str[pos+6] = 'a';
		}

		cout << str << endl;
	}

	return 0;
}

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

int main(){
	int num;
	std::string false;
	std::string true;
	std::string english;
	std::cin >> num;

	false = "Hoshino";
	true = "Hoshina";
	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==false) english[j]=true;
		}
		std::cout << english;
	}
    return 0;
}

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

static const std::string MISS_STR = "Hoshino";

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

    while (0 < n--) {
        std::string str;
        std::getline(std::cin, str);

        const unsigned int str_size = str.size();
        unsigned int cur = 0;
        std::string::size_type pos = str.find(MISS_STR, 0);

        while (pos != std::string::npos && cur <= str_size) {
            str[pos + 6] = 'a';

            // increase cursor
            cur += (pos + MISS_STR.size());
            pos = str.find(MISS_STR, cur);
        }

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

    return 0;
}

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

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string s;
		bool fir=true;
		while(cin>>s){
			char c;
			c=getchar();
			if(!fir)cout<<" ";
			if(s=="Hoshino")cout<<"Hoshina";
			else cout<<s;
			if(c=='\n')break;
			fir=false;
		}
		cout<<endl;
	}	
}

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

int main()
{
    int n;
    string str, hosino = "Hoshino";

    cin >> n;
    getline( cin, str );                // cinで残された改行コード回収

    for( int o = 0; o < n; o++ )
    {   
        getline( cin, str );
        if( str.size() >= 7 )
        {
            for( int i = 0; i < str.size() - 6; i++ )
            {
                int k = i, j = 0;
                while( j <= 6 && str[k] == hosino[j] )
                {
                    k++;
                    j++;
                }
                if( j == 7 )
                    str[k-1] = 'a';
            }
        }
        cout << str << endl;
    }

    return 0;
}