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++: // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef map<int, int> MAPII;
typedef vector<pair<int, int> > VPII;

#define MP make_pair
#define fastIO	cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (未test)
// #define FOREACH_IT(it,c)	for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(), c_end=c.end(); it!=c_end; ++it)

// ------------------- include, typedef, define END. -------------------

int main(){
	fastIO;
	int n;
	string bun;
	string before = "Hoshino", after = "Hoshina";
	// cinに続きgetlineする場合は改行読み捨てを行う.
	// 参考：http://wikiwiki.jp/kyopro/?%A5%D7%A5%ED%A5%B0%A5%E9%A5%DF%A5%F3%A5%B0%A4%CE%A5%C6%A5%AF%A5%CB%A5%C3%A5%AF%2F%C6%FE%CE%CF%A4%CE%BD%E8%CD%FD%28C%2CC%2B%2B%29
	
	// 文字列操作 参考：http://minus9d.hatenablog.com/entry/20120519/1337412307

	cin >> n; cin.ignore();
	while (n--){
		getline(cin, bun);
		
		int pos = bun.find(before);
		while (pos != string::npos){
			bun.replace(pos, before.size(), after);
			pos = bun.find(before, pos + after.size());
		}

		cout << bun << endl;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	int n;
	scanf("%d\n", &n);
	string name = "Hoshino";
	while(n--)
	{
		string s;
		getline(cin, s);
		int length = s.length() - name.length() + 1;
		for(int i = 0; i < length; ++i)
		{
			bool flag = true;
			for(int j = 0; j < name.length(); ++j)
			{
				if(s[i + j] != name[j])
				{
					flag = false;
					break;
				}
			}
			if(flag)
			{
				s[i + name.length() - 1] = 'a';
			}
			else
			{
				continue;
			}
		}
		cout << s << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<vector>
#include<cstring>

using namespace std;

string in;

int main(){
  int num;
  cin >> num;
  getline(cin,in);
  while(num--){
    getline(cin,in);
    vector<int> V;
    V.push_back(-7);
    
    while(1){
      int n = in.find("Hoshino",V.back()+7);
      if(n != -1) V.push_back(n);
      else break;
    }

    for(int i = 1; i < V.size(); i++)
      in.replace(V[i],7,"Hoshina");
    
    cout << in << endl;
  }
  return 0;
}

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

int main(){
	int n; // the number of datasets
	std::cin >> n;
	std::cin.ignore();

	for(int i = 0; i < n; ++i){
		std::string text;
		std::getline(std::cin, text); // input
		
		int text_size = text.size();
		int moji = text.find("Hoshino");
		while(moji != std::string::npos){
			text.replace(moji, 7, "Hoshina");
			moji = text.find("Hoshino", moji);
		}
		
		std::cout << text << std::endl; //output
	}

	return 0;
}

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

int main()
{
	int n;
	char str[1001];

	scanf("%d", &n);
	for (int i = 0; i < n+1; i++) {
		fgets(str, 1001, stdin);
		str[strlen(str) - 1] = '\0';

		while (1) {
			if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
			else break;
		}
		puts(str);
	}

	return 0;
}

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

void strReplace(std::string& str){
	const std::string wrong_word = "Hoshino";
	const std::string correct_word = "Hoshina";
	
	std::string::size_type pos = str.find(wrong_word, 0);
	
	while(pos != std::string::npos){
		str.replace(pos, wrong_word.length(), correct_word);
		pos = str.find(wrong_word, pos+correct_word.length());
	}
}

int main(){
	int n;
	std::cin >> n;
	std::cin.ignore();
	
	for(int i=0; i<n; ++i){
		std::string str;
		std::getline(std::cin, str);
		strReplace(str);
		std::cout << str << std::endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
#include <string.h>

#define X first
#define Y second
#define MP make_pair
typedef long long ll;
using namespace std;
const int MAX = 101;

template<class T, class U>
void convert(T &t, U &u){
	stringstream ss;
	ss << t;
	ss >> u;
}

int main(){
	int n;
	cin >> n;
	cin.ignore();
	while(n--){
		string s;
		getline(cin, s);
		for(int i = 0; i < s.size(); i++){
			int res = s.find("Hoshino", i);
			if(res == -1) break;
			s.replace(res, 7, "Hoshina");
			i += 7;
		}
		cout << s << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
        int n;
        scanf("%d ",&n);
        string a[n];
        for(int i=0;i<n;i++){
                getline(cin,a[i]);
                while(1){
                int index=0;
                index=a[i].find("Hoshino",index);
                if((int)string::npos==index)break;
                a[i][index+6]='a';
                }
        }
        for(int i=0;i<n;i++){
        cout<<a[i]<<"\n";
        }
        return 0;
}

C++: #include <iostream>
#include <iterator>
#include <string>
using namespace std;
int main()
{
	bool flg;
	int n, i, c;
	string w, s;
	unsigned int x;
	while (cin >> n)
	{
		if (cin.eof()) break;
		for (i = 0; i < n; i++)
		{
			c = 0;
			s = "";
			while (1)
			{
				w = "", flg = false;
				cin >> w;
				if (w == "Hoshino.")
					s += "Hoshina.", flg = true;
				if (w == "Hoshino")
					s += "Hoshina", flg = true;
				if (!flg)
					s += w;
				if (cin.get() == '\n') break;
				s += " ";
			}
			s.erase(s.end(), s.end());
			cout << s << endl;
		}
	}
	return 0;
}

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

//Hoshino search and replace Hoshina
void replace_word(std::string s){
	const std::string find_word("Hoshino");
	//Hoshino search
	std::string::size_type pos = s.find(find_word);
	while(pos != std::string::npos){
		//Hoshino replace Hoshina
		s.replace(pos, find_word.length(), "Hoshina");
		pos = s.find(find_word, pos + find_word.length());
	}
	//output
	std::cout << s << std::endl;
	return;
}

int main(){
	std::string s;
	int num;
	std::cin >> num; //data set
	std::getline(std::cin, s); //read a new line
	for(int i=0; i<num; ++i){
		//read text
		std::getline(std::cin, s);
		//replace
		replace_word(s);
	}
}

C++: #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
	int n;
	cin >> n;
	char *ho = "Hoshino";
	rep(i,n+1) {
		char c, s[2010];
		rep(j, 2000) {
			scanf("%c", &c);
			if(c == '\n') {
				s[j] = '\0';
				break;
			} else {
				s[j] = c;
			}
		}
		for(int j = 0; s[j] != '\0'; ++j) {
			int f = 1;
			rep(k,7) {
				if(s[j + k] != ho[k]) {
					f = 0;
					break;
				}
			}
			if(f) s[j + 6] = 'a';
		}
		printf("%s",s);
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
    int n,now;
    char a[1000],c;
    while(scanf("%d",&n)!=EOF){
        now=0;
        while(now<n){
        if(a[0]=='H'&&a[1]=='o'&&a[2]=='s'&&a[3]=='h'&&a[4]=='i'&&a[5]=='n'&&a[6]=='o'&&a[7]=='\0')printf("Hoshina");
        else printf("%s",a);
        scanf("%c",&c);
        printf("%c",c);
            if(c=='\n')now++;
        a[7]='\0';
    }
    }
}