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<stdio.h>

int main()
{
	int n,i,j=0,k;
	char str[1008],temp;
	
	scanf("%d",&n);
	temp=getchar();
	for(i=0;i<n;i++){
		for(j=0;;j++){
			str[j] = getchar();
			if(str[j] == '\n'){
				str[j] = '\0';
				break;
			}
		}
		
		for(k=0;k<j;k++){
			if((str[k]=='H' && str[k+1]=='o' && str[k+2]=='s' && str[k+3]=='h' && str[k+4]=='i' && str[k+5]=='n' && str[k+6]=='o') && (str[k+7]=='\0' || str[k+7]==' ' || str[k+7]=='.' || str[k+7]=='!' || str[k+7]=='?' || str[k+7]==','))str[k+6]='a';
		}
		printf("%s\n",str);
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
char text[1001];
int main(){
	int i,ii,j,n,a;
	cin>>n;
	
			for(i=0;i<n;i++){
			while(gets(text)){a=strlen(text);
			for(j=0;j<a-6;j++){
				if(text[j]=='H'&&text[j+1]=='o'&&text[j+2]=='s'&&text[j+3]=='h'&&text[j+4]=='i'&&text[j+5]=='n'&&text[j+6]=='o'){
					text[j+6]='a';j+=6;
				}
			}
			if(i!=0)cout<<endl;
			cout<<text;
		}
	}
    return 0;
}

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

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

int main()
{
	int n;

	cin >> n;
	cin.get();

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, 7, "Hoshina" );
			index += 7;
		}
		cout << s << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	int n;
	//cin>>n;
	string t;
	getline(cin,t);
	n=atoi(t.c_str());
	rep(i,0,n){
		string s;
		getline(cin,s);
		//o(" "<<s);
		while(1){
			if(s.find("Hoshino")!=string::npos){
				s.replace(s.find("Hoshino"),7,"Hoshina");
			}
			else break;
		}
		o(s);
	}
}

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

using namespace std;

int main() {
	int n, pos;
	string str;

	cin>>n; cin.get( );
	while(n--){
		getline(cin, str); 
		while(pos = str.find("Hoshino"),pos!=string::npos){
			str.replace(pos, 7, "Hoshina");
		}
		cout<<str<<"\n";
	} 
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <vector>
#include <algorithm>

#define int64 long long int
using namespace std;

int main()
{
	int n, c, buf, len;
	char str[1024]={0};
	cin >> n;

	if((c = getchar()) == '\n')
	for(int i=0; i<n; i++){
		buf = 0;
		while(1){
			c = getchar();
			if(c == '\n' || c == EOF){
				str[buf] = '\0';
				break;
			}
			str[buf] = c;
			buf++;
		}
		len = strlen(str);
		for(int j=0; j<=len-7; j++){
			if(str[j] != 'H') continue;
			if(str[j+1] != 'o') continue;
			if(str[j+2] != 's') continue;
			if(str[j+3] != 'h') continue;
			if(str[j+4] != 'i') continue;
			if(str[j+5] != 'n') continue;
			if(str[j+6] != 'o') continue;
			str[j+6] = 'a';
		}
		printf("%s\n", str);
		memset(str, 0, 1024);
	}

	return 0;
}

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

int main(){
	int data_set;
	std::cin >> data_set;
	std::cin.get();
	std::string document[data_set];
	for(int i = 0; i < data_set; ++i){
		std::getline(std::cin, document[i]);
	}
	for(int i = 0; i < data_set; ++i){
		auto pos = document[i].find("Hoshino");
		while(pos != std::string::npos){
			document[i].replace(pos, 7, "Hoshina");
			pos = document[i].find("Hoshino", pos + 7);
		}
		std::cout << document[i] << std::endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

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();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

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

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int dx[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dy[8] = {0, -1, 0, 1, -1, 1, -1, 1};

int main() {
  int n;
  string s;

  cin >> n;
  getline(cin, s);
  REP(i, n) {
    getline(cin, s);
    while(1) {
      string::size_type index = s.find("Hoshino");
      if(index == string::npos) break;
      else s.replace(index, 7, "Hoshina");
    }
    cout << s << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  cin>>n;
  cin.ignore();
  rep(i,n){
    string s;
    getline(cin,s);
    string ans="";
    rep(j,s.size()){
      if(j+6<s.size() && s.substr(j,7)=="Hoshino")
        ans+="Hoshina",j+=6;
      else
        ans+=s[j];
    }
    cout<<ans<<endl;
  }
}

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

int main(void)
{
	int n, i;
	char a[1000][1000] = {0};
	char *p;

	scanf("%d\n", &n);
	
	for (i = 0; i < n; i++)
		gets(a[i]);

	for (i = 0; i < n; i++)
	{
		p = strstr(a[i], "Hoshino");
		if (p != NULL)
			p[6] = 'a';
	}

	for (i = 0; i < n; i++)
		puts(a[i]);

	return 0;
}