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<algorithm>
#include<vector>
#include<cstdio>
#include<string>

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define f first
#define s second

using namespace std;

typedef long long ll;

int main(){
  string str;
  int n;
  getline(cin, str); sscanf(str.c_str(),"%d",&n);
  while(n --> 0){
    int pos;
    getline(cin, str);
    while((pos = str.find("Hoshino")) != string::npos){
      str[pos+6] = 'a';
    }
    cout << str << endl;
  }
  return 0;
}

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

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

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

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

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;c=getchar();
	for(j=0;j<n;j++){
	 //??\????????????
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c=='\n'){
	   break;
	  }else{
	   switch(flg){
		case 0:
		if(c=='H'){flg++;}
		break;
		case 1:
		if(c=='o'){flg++;}else{flg=0;}
		break;
		case 2:
		if(c=='s'){flg++;}else{flg=0;}
		break;
		case 3:
		if(c=='h'){flg++;}else{flg=0;}
		break;
		case 4:
		if(c=='i'){flg++;}else{flg=0;}
		break;
		case 5:
		if(c=='n'){flg++;}else{flg=0;}
		break;
		case 6:
		if(c=='o'){c='a';}
		flg=0;
		break;
	   }
	   cout<<c;
	  }
	 }
	 cout<<endl;
	}
	return 0;
}

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

#define BAD "hoshino"

int hoge(void);

int main(){
	int n,i;
	
	cin>>n;
	for(i=0;i<n;i++){
	 hoge();
	}
	
	return 0;
}

int hoge(){
	string text;
	int i;
	
	cin>>text;
	for(i=0;i<text.length();i++){
	 if(text.substr(i,BAD.length())==BAD){
	  text[i+BAD.length()-1]='a';
	 }
	}
	
	cout<<text<<endl;
	return 0;
}

C++: 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <bitset>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
#define strtok_r strtok_s
#endif

#define ITER(c)             __typeof__((c).begin())
#define FOREACH(it, c)      for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)            __typeof__((c).rbegin())
#define RFOREACH(it, c)     for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)           REPEAT(i, 0, n)
#define RREP(i, n)          RREPEAT(i, 0, n)
#define REPEAT(i, k, n)     for(int i = (k); i < (k+n); ++i)
#define RREPEAT(i, k, n)    for(int i = (k)+(n)-1; i >= (k); --i)
#define FROMTO(i,f,t)       for(int i = f; i < t; i++)
#define ALL(c)              (c).begin(), (c).end()
#define LLPOW(p1,p2)        ((ll)pow((double)(p1), (int)p2))
#define ESIZEOF(A)          (sizeof(A)/sizeof((A)[0]))
#define CIN_NO_SYNC         do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)
#define GETSTR(p)           fgets((p), sizeof(p), stdin)
#define CHOMP(p)            do{ char *_q = (p) + strlen(p)-1; if(*_q == '\n' || *_q == '\r') *_q = 0; } while(0)
#define FILL(m,v)           memset(m, v, sizeof(m))
#define mp                  make_pair
#define pb                  push_back
template<class _T> _T MAX(_T p1,_T p2){return (p1>p2)?p1:p2;} 
template<class _T> _T MIN(_T p1,_T p2){return (p1<p2)?p1:p2;} 

typedef long long ll;
typedef unsigned long long ull;

#define X real()
#define Y imag()
typedef double D;
typedef complex<D> P;
#define EPS (1e-9)

#ifdef _DEBUG
template<class _T>
inline void _prfe(const char *_n, _T _c, bool _p = false){
    ITER(_c) _it=_c.begin();
    if(_p){ cout<<_n<<" = ["<<endl;for(;_it!=_c.end();++_it)cout<<"    "<<*_it<<endl;cout<<"]"<<endl; }
    else{ cout<<_n<<" = [ "<<*_it++;for(;_it!=_c.end();++_it)cout<<", "<<*_it;cout<<" ]"<<endl; }
}
#define pf printf
#define pr(n) do{cout<<#n" = "<<(n)<<endl;}while(0)
#define prfe(n) _prfe(#n, n)
#define prfep(n) _prfe(#n, n, true)
#define dbgchk(n) do{if(n)throw;}while(0)
#else
#define pf(...) /* */
#define pr(...) /* */
#define prfe(...) /* */
#define prfep(...) /* */
#define dbgchk(...) /* */
#endif

string solve(string &s){
    char *p = (char *)s.c_str();
    while(1){
        p = strstr(p, "Hoshino");
        if(p == NULL) break;
        memcpy(p, "Hoshina", 7);
    }
    return s;
}

int main(){
    int n;
    string s;
    getline(cin, s);
    stringstream ss(s);
    ss >> n;
    REP(i,n){
        getline(cin, s);
        cout << solve(s) << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
    int n,i,j;
    string str;
    cin >> n;
    getline(cin,str);
    for(i=0;i<n;i++){
        getline(cin,str);
        for(j=0;j<str.size();j++){
            if(j+6 > str.size()) break;
            if(str[j] == 'H' && str[j+1] == 'o' && str[j+2] == 's' && str[j+3] == 'h' && str[j+4] == 'i' && str[j+5] =='n' && str[j+6] == 'o'){
                str[j+6] = 'a';
            }
        }
        cout << str << endl;
    }
    return 0;
}

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

using namespace std;

void solve()
{
	int n;
	scanf("%d\n", &n);
	string name = "Hoshino";
	while(n--)
	{
		string s;
		getline(cin, s);
		for(int i = 0; i < s.length() - name.length() + 1; ++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 <string>

std::string replaceWord(const std::string wrong_word, const std::string right_word, std::string 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);
    }
	
	return str;
}

int main(){
    std::string w_word("Hoshino");
    std::string r_word("Hoshina");
	
    int num;
    std::cin >> num;
    std::cin.ignore();
      
    for(int i = 0; i < num; ++i){
        std::string str;
        std::getline(std::cin, str);
        std::cout << replaceWord(w_word, r_word, str) << std::endl;
    }
	
    return 0;
}

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

using namespace std;

int main() {
	int n; scanf("%d\n", &n);
	for (int i = 0; i < n; ++i) {
		string str = "";
		while (1) {
			char c;
			if (scanf("%c", &c) == EOF) c = '\n';
			if (c == ' ' || c == '\n') {
				if (str == "Hoshino") cout << "Hoshina";
				else cout << str;
				cout << c;

				str = "";

				if (c == '\n') break;
			}
			else str += c;
		}
	}
}

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

using namespace std;

int main() {
  int n;
  string str;
  getline(cin, str);
  n = atoi(str.c_str());

  for (int i = 0; i < n; ++i) {
    string str;
    getline(cin, str);

    int pos = -1;
    while (pos = str.find("Hoshino", pos + 1), pos != string::npos)
      str.replace(pos, 7, "Hoshina");
    cout << str << endl;
  }
}