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>
#include <cstdio>
using namespace std;
int main(){
  int n ,i=0 ,index;
  string s;
  cin >> n;

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

  return 0;
}

C++: //#include <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
	for(int j = 0; j<= n; j++)
	{
	
		char s[MAX_SIZE] = {};
		scanf("%s",s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hoshina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}
		if(j != 0) cout << endl;
	}
	return 0;

}

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

int main(){
	int data;
	std::cin >> data;  //dataset
	std::cin.ignore();
	
	std::string mis = "Hoshino";
	std::string correct = "Hoshina";
	
	for(int i=0; i<data; ++i){
		std::string  sentence;
		
		std::getline(std::cin, sentence);
		
		std::string::size_type index = sentence.find(mis);
		
		if(index == std::string::npos){
			std::cout << sentence << std::endl;
		}else{
			while(index != std::string::npos){
				sentence.replace(index, mis.length(), correct);
				index = sentence.find(mis, index + correct.length());
			}
			std::cout << sentence << std::endl;
		}
	}
	
	return 0;
}

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

using namespace std;

int main(){
  int i, n;
  string str;
  string str2 = "Hoshino";
  string::iterator iter;

  cin >> n;

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

    iter = str.begin();
    while(1){
      iter = search(iter, str.end(), str2.begin(), str2.end());
      if(iter == str.end()) break;

      iter += 6;
      *iter = 'a';
    }
    if(i != 0)
      cout << str << endl;
  }

  return 0;
}

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

int main(){
	int num;
	std::string str;
	const std::string wrong_word("Hoshino");
	const std::string right_word("Hoshina");
	std::cin >> num;
	std::cin.ignore();
	
	while(num != 0){
		std::getline(std::cin, 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);
		}
		
		std::cout << str << std::endl;
		--num;
	}
}

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[2000];
		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 <iostream>
#include <string>

using namespace std;

int main()
{
	int n;
	string str;
	
	cin >> n;
	cin.ignore();
	while (n > 0){
		getline(cin, str);
		int len = 1;
		while (1){
			len = str.find("Hoshino", len - 1);
			if (len == -1)  break;
			str[len + 6] = 'a';
		}
		cout << str << endl;
		n--;
	}
	return (0);
}

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

int main()
{
	int n;
	char buf[1100];
	std::cin>>n;
	std::cin.getline(buf,1);

	for(int i=0;i<n;i++)
	{
		std::cin.getline(buf,1100);
		
		std::string str(buf);
		bool found=true;
		int index=0;
		int place;

		while(found)
		{
			found=false;
			place=str.find("Hoshino",index);
			
			if(place!=std::string::npos)
			{
				str.replace(place,7,"Hoshina");
				found=true;
			}
		}
		std::cout<<str<<std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>
#include <numeric>
#include <sstream>

#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1;i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define PI 3.14159265358979

using namespace std;

//================================================

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int N;
	cin >> N;
	string S, from = "Hoshino";
	REP(i, N) {
		getline(cin, S);

		REP(i, S.size() - 6) {
			if (S.substr() == from) S.replace(i, 7, "Hoshina");
		}
		cout << S << "\n";
	}
	return 0;
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;cin.ignore(2);

  string input;

  for(int i=0;i<line_length;++i){
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main()
{
	int n;
	cin >> n;
	cin.ignore();
	rep(i,n)
	{
		string s;
		getline(cin,s);

		rep(j,s.length()-6)
		{
			if(s[j] == 'H' && s[j+1] == 'o' && s[j+2] == 's' && s[j+3] == 'h' && s[j+4] == 'i' && s[j+5] == 'n' && s[j+6] == 'o')
			{
				s[j+6] = 'a';
				j += 6;
			}
		}

		cout << s << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000009
#define EPS 1E-9

int n;
string s;
int pos;

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

  while(n--){
    getline(cin, s);
    while((pos = s.find("Hoshino")) >= 0) s[pos + 6] = 'a';
    cout << s << endl;
  }

  return 0;
}

C++: import java.util.*;
public class AOJ0101 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		sc.nextLine();
		while(t--!=0)
			System.out.println(sc.nextLine().replace("Hoshino", "Hoshina"));
	}
}

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

using namespace std;

int main()
{
    string S, P; int N;
    
    getline(cin, P);
    
    N = stoi(P);
    
    for(int i = 0; i <= N; i++)
    {
        getline(cin, S);
        
        while(S.find("Hoshino") != string::npos)
        {
            S.replace(S.find("Hoshino"), 7, "Hoshina");
        }
        
        cout << S << endl;
    }
    
    return 0;
}