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 <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
#define INF 100000000
#define SIZE 6 // Hoshinaの文字数-1
typedef long long ll;

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

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

using namespace std;

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

	string rect = "Hoshino";

	for (int t = 0; t < n; ++t) {
		char c; int pos = 0;
		while ((c = getchar()) != EOF) {
			if (c != rect[pos]) pos = c == rect[0];
			else if (++pos == rect.size()) pos = 0, c = 'a';
			cout << c;
		}
	}
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	std::string str;
	
	while(std::cin >> str){

		std::string::size_type pos = str.find("Hoshino");
		
		while(pos != std::string::nops){
			 str.replace(pos, find_word.length(), correct_word);
			 pos = str.find(find_word, pos + find_word.length());
		}
	
	std::cout << str << std::endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    cin.ignore();

    while (n--) {
        string str;
        getline(cin, str);

        size_t pos = 0;
        while ((pos = str.find("Hoshino", pos)) != string::npos) {
            str.replace(pos, 7, "Hoshina");
        }

        cout << str << endl;
    }

    return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	string a;

	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, strlen("Hoshino"), "Hoshina");
		cout << a << endl;
	}
	
	return 0;
}

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    cin.ignore();

    while (n--) {
        string in;
        getline(cin, in);

        stringstream ss(in);
        string word;
        string out;
        while (ss >> word) {
            if (word == "Hoshino") {
                out += "Hoshina ";
            } else {
                out += word + ' ';
            }
        }
        out.erase(out.end() - 1);

        cout << out << endl;
    }

    return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <ctime>
#include <climits>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <tuple>
#include <bitset>
#include <unordered_map>

using namespace std;

int main() {
    const string search = "Hoshino";

    int n;
    cin >> n;
    cin.get();

    string text;
    while (n --) {
        getline(cin, text);
        for (int i=0; i<(int)text.size(); ) {
            int j;
            for (j=0; j<(int)search.size(); ++j) {
                if ((int)text.size() < i+j || search[j] != text[i+j]) {
                    i += (j == 0 ? 1 : j);
                    break;
                }
            }
            if (j == (int)search.size()) {
                text[i+j-1] = 'a';
                i += j;
            }
        }
        cout << text << endl;
    }

    return 0;
}

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

int main(){
	string str;
	int n;
	cin >> n;
	getline(cin, str);
	for (int i = 0; i < n; i++) {
		getline(cin, str);
		for (int j = 0; j < str.size() - 6; j++) {
			if (str[j] == 'H') {
				if (str.substr(j + 1, 6) == "oshino")str.replace(j, 7, "Hoshina");
				else if (str.substr(j + 1, 6) == "oshina")str.replace(j, 7, "Hoshino");
			}
		}
		cout << str << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string str, judge = "";
	int n, count = -1;
	cin >> n;
	for (int i = 0; i < n; i++) {
		if (i == 0) { getline(cin, str); }
		getline(cin, str);
		for (int j = 0; j < str.size(); j++) {
			judge += str[j];
			//cout << judge << endl;
			if (str[j+1] == ' ' || j == str.size() - 1) {
				count++;
				if (judge == "Hoshino" && count == 0) {
					cout << "Hoshina";
				}
				else if (judge == " Hoshino" && count > 0) {
					cout << " Hoshina";
				}
				else {
					cout << judge;
				}
				judge = "";
			}
		}
		cout << endl;
		count = -1;
	}
	return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int main()
 {
   int n;
   cin>>n;
   getchar();
   while(n--)
   {
     string s;
     getline(cin,s);
     while(s.find("Hoshino")!=string::npos)
     {
       s.replace(s.find("Hoshino"),7,"Hoshina");                                      
     }          
     cout<<s<<endl;
   }
   //while(1);
   return 0;
 }

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stdio.h>
using namespace std;
int main()
{
	int c,n;
	string s;
	string ho="Hoshino";
	cin >> n;
	for (int r = 0; r <= n; r++){
		s.clear();
		while ((c = getchar()) != '\n'){
			s += c;
		}
		for (int i = 0; i < s.size(); i++){
			int flag = 0;
			if (s[i] == 'H'){
				for (int i2 = 0; i2 < ho.size(); i2++){
					if (s[i + i2] != ho[i2]){
						flag = 1;
						break;
					}
				}
				if (flag == 0){
					s[i + ho.size() - 1] = 'a';
				}
			}
		}
		if (r != 0){
		cout << s << endl;
		}
	}
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
    int n,i=0;
    string s;
    cin>>n;
    for(;i<n;i++){
        getline(cin,s);
        while(s.find("Hoshino")!=string::npos)s.replace(s.find("Hoshino"),7,"Hoshina");
        cout<<s<<endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;
int main()
{
	char ch;
	int n;
	cin>>n;
	cin.get(ch);
	for(int i=0;i<n;i++)
	{
		string str;
		while(1)
		{
			cin.get(ch);
			if(ch=='\n')break;
			str+=ch;
		}
		while(1)
		{
			int idx=str.find("Hoshino");
			if(idx==-1)break;
			str[idx+6]='a';
		}
		cout<<str<<endl;
	}
	
	return 0;
}

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

int n;
char buf[1000000];

int main() {
  scanf("%d ", &n);
  while (n--) {
    fgets(buf, sizeof(buf), stdin);
    
    string ans(buf);
    while (1) {
      int pos = ans.find("Hoshino");
      if (pos == string::npos) break;
      ans = ans.replace(pos, strlen("Hoshino"), "Hoshina");
    }
    printf("%s", ans.c_str());
  }
}

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

int main(){
	long long int n;
	char* a;
	char letter[1000];
	char letter2[1000];
	memset(letter2 , 0 , sizeof(letter2));
	cin >> n;
	while(1){
		
			cin >> letter;
		
		do {
			a=strstr(letter , "Hoshino");
			if (a==NULL) break;
			strncpy(a , "Hoshina" , 7);
			
		} while (a!=NULL);
		strcat(letter2 , letter);
		strcat(letter2 , "\n");
		n--;
		if (!n) break;
	}
	cout << letter2 << endl;
	return 0;
}