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

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

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) {
            // fix miss
            for (unsigned int i = cur; i < pos; i++) {
                std::cout << str.at(i);
            }
            std::cout << CORRECT_STR;

            // increase cursor
            cur += (pos + MISS_STR.size());

            pos = str.find(MISS_STR, cur);
        }

        for (unsigned int i = cur; i < str_size; i++) {
            std::cout << str.at(i);
        }
        std::cout << std::endl;
    }

    return 0;
}

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

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    cin >> data_set_num;
    //std::getline(std::cin,str);
    //sscanf(str.c_str(),"%d ",&data_set_num);

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

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

string str;
int n;


string solve(string str){
        for(int i=0;i<str.size()-6;i++){
                if(str[i]=='H')
                        if(str[i+1]=='o')
                                if(str[i+2]=='s')
                                        if(str[i+3]=='h')
                                                if(str[i+4]=='i')
                                                        if(str[i+5]=='n')
                                                                if(str[i+6]=='o')
                                                                        str[i+6]='a';
        }
return str;
}

int main(){
        scanf("%d\n", &n);
        for(int i=0;i<n;i++){
                getline(cin, str);
                cout << solve(str) << endl;
        }
}

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

int main() {

entry:

  int n; cin >> n;
  if (!cin) return 0;
  if (n == 0) return 0;
  {
    char c;
    scanf("%c", &c);
  }

  while (n--) {
    for (int st = 0;;) {
      char c;
      scanf("%c", &c);
      if (c == '\n') break;
      if (st == 0 && c == 'H') st = 1;
      else if (st == 1 && c == 'o') st = 2;
      else if (st == 2 && c == 's') st = 3;
      else if (st == 3 && c == 'h') st = 4;
      else if (st == 4 && c == 'i') st = 5;
      else if (st == 5 && c == 'n') st = 6;
      else if (st == 6 && c == 'o') st = 7;
      else st = 0;

      if (st == 7) {
        st = 0;
        cout << 'a';
      }
      else {
        cout << c;
      }
    }
    cout << endl;
  }

  goto entry;

  return 0;
}

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

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

using namespace std;

int main(){
  int n;
  cin>>n;
  cin.ignore();
  while(n--){
    string s;
    getline(cin,s);
    for(int i;(i=s.find("Hoshino"))!=string::npos;){
      s[i+6]='a';
    }
    cout<<s<<endl;
  }
  return 0;
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int n;
    string s;
    cin >> n;
    getline(cin, s);
    rep(i, n)
    {
        getline(cin, s);
        while (s.find("Hoshino") != string::npos)
        {
            int a = s.find("Hoshino");
            s.replace(a, 7, "Hoshina");
        }
        OP(s);
    }
    return 0;
}

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

int main(void){
    int datanum;
    char s[1001], *p;
    
    scanf("%d", &datanum);
    fgets(s,sizeof(s),stdin); // skip \n
    for (int i=0; i<datanum; i++){
        fgets(s,sizeof(s),stdin);
        while (p = strstr(s, "Hoshino")){
            p[6] = 'a';
        }
        printf("%s", s);
    }
    
    return 0;   
}

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

using namespace std;

int main(void)
{
	int n;
	string a;
	string g = "Hoshino";

	cin >> n;
	cin.ignore();

	for (int i = 0; i < n; ++i){
		int x = 0;
		getline(cin, a);
		if ((x = a.find("Hoshino")) >= 0)
			a.replace(x, g.length(), "Hoshina");
		cout << a << endl;
	}
	
	return 0;
}

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

void convert(string& target, string before, string after) {
    while(target.find(before) != string::npos) {
        target.replace(target.find(before), before.length(), after);
    }
}

int main(void) {
    int num;
    cin >> num;
    cin.ignore();
    for(int r = 0; r < num; r++) {
        string input; getline(cin, input);
        convert(input, "Hoshino", "Hoshina");
        cout << input << endl;
    }
    return(0);
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int n,i;
  scanf("%d ",&n);
  while(n--){
    string s;
    for(getline(cin,s),i=0;i<s.size();i++){
      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]=='a')s[i+6]='o';
    }
    cout<<s<<endl;
  }
}