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 <iostream>
#include <string>

int main() {

	int n;//dataset
	std::string st_1,st_2;

	st_2 = "Hoshino";

	std::cin >> n;
	std::cin.ignore();

	for (int i = 0; i < n; ++i)
	{
		getline(std::cin,st_1);

		std::string::size_type pos = st_1.find(st_2);

		while (pos != std::string::npos) {
			st_1.replace(pos, st_2.length(), "Hoshina");
			pos = st_1.find(st_2,pos+st_2.length());
		}

		std::cout << st_1 << std::endl;

	}

	return 0;
}

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

int main(){
	int dataN,i,j,tmp;
	string str;
	
	cin>>dataN;
	for(j=0;j<dataN;j++){
	 cin>>str;
	 for(i=0;i<str.length;i++){
	  if(str[i]+str[i+1]+str[i+2]+str[i+3]+str[i+4]+str[i+5]+str[i+6]=="Hoshino"){
	   str[i+6]='a';
	   i+=6;
	  }
	 }
	 cout<<str;
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int num;
  cin >> num;
  string trash;
  getline(cin,trash);
  for(int j = 0; j < num; j++){
    string in;
    getline(cin,in);
    int status = 1;
    string out;
    in += '\n';
    for(int i = 0; i < in.length(); i++){
      if(status){
	if(i == in.length()-1) cout << in[i];

	out = in[i];
	status = 0;
	continue;
      }
      if(in[i] >= 'a' && in[i] <= 'z'|| in[i] >= 'A'&& in[i] <= 'Z'){
	out += in[i];
	status = 0;
      }else{
	if(out == "Hoshino") cout << "Hoshina" << in[i];
	else cout << out << in[i];
	status = 1;
      }
    }
  }
  return 0;
}

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

using namespace std;
int main(){
	int n,i,j,h;
	char *p;
	char buf[1100];
	string str;
	string hit="Hoshino";
	cin>>n;
	string tmp;
	getline(cin,tmp);
	for(int j=0;j<n;j++){
		string buf;
		getline(cin,buf);
		if(buf.size()==0)break;
		stringstream ss(buf);
		for(int i=0;ss >> str;i++){
			if(i)cout<<" ";
			for(int i=6;i<str.size();i++){
				string sub="";
				for(int j=i-6;j<=i;j++)sub+=str[j];
				if(sub==hit)str[i]='a';
			}
			cout<<str;
		}
		cout<<endl;
	}
	return 0;
}

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

using namespace std;

int main(){
  int n;
  char line[1000];
  fgets(line,sizeof(line),stdin);
  sscanf(line,"%d",&n);
  char buf[1001];
  for(int i=0;i<n;i++){
    char s[1001];
    fgets(buf,1001,stdin);
    sscanf(buf,"%[^\n]",s);
    int j=0;
    while(s[j]!='\0'){
      if(strncmp((s+j),"Hoshino",7)==0){
	s[j+6]='a';
      }
      j++;
    }
    printf("%s\n",s);
  }
  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";
    std::cin >> data_set_num;
    std::cin.ignore();

    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>
#include <cstring>
using namespace std;

int main()
{
	int n;
	char str[1024];

	scanf("%d ", &n); // neglect \n

	for (int i = 0; i < n; i++){
		fgets(str, sizeof(str), stdin); // include space 

		int len = strlen(str);
		for (int j = 0; j < len - 6; j++){
			if (strncmp(str + j, "Hoshino", 7) == 0){
				str[j + 6] = 'a';
			}
		}

		cout << str;
	}

	return (0);
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#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()

int main() {
  int n;
  cin >> n;
  cin.ignore();
  while(n--) {
    string line;
    getline(cin,line);
    string st = "Hoshino";
    REP(i,line.length()-6) {
      if (line.substr(i,7) == st)
        line.replace(i,7,"Hoshina");
      i+=7;
    }
    cout << line << endl;
  }
}

C++: #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 = 0; i < s.size() - 6; i++) {
      if (s.size() < 7) break;
      string t = s.substr(i, 7);
      if (t == "Hoshino") {
	s[i] = 'H';
	s[i + 1] = 'o';
	s[i + 2] = 's';
	s[i + 3] = 'h';
	s[i + 4] = 'i';
	s[i + 5] = 'n';
	s[i + 6] = 'a';
      }
    }
    cout << s << endl;
  }
  return 0;
}

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

string t = "Hoshino";

int main(void) {
  int n;
  string str;
  
  cin >> n;
  cin.ignore();
  for(int j=0; j<n; j++) {
    getline(cin, str);
    for(int i=0; i<str.size()-6; i++) {
      if(str.substr(i, 7) == t) { str[i+6] = 'a'; i+=7; }
    }
    cout << str << endl;
  }
  
  return 0;
}

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

using namespace std;

int main(){
	
	int n;
	
	string str;
	
	cin >> n;
	
	cin.ignore();
	for(int loop = 0; loop < n; loop++){
		getline(cin, str);
		
		for(int i = 0; i < str.size() - 6; i++){
			if(str[i] == 'H' && str[i + 1] == 'o' && str[i + 2] == 's' && str[i + 3] == 'h' && str[i + 4] == 'i' && str[i + 5] == 'n' && str[i + 6] == 'o'){
				str[i + 6] = 'a';
			}
		}
		
		cout << str << endl;
	}
	
	return 0;
}

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

int main(){
  int n;
  char c,tmp;
  int f;

  cin >> n;
  getchar();

  f = 0;
  while(n){
    c = getchar();
    if(f == 0 && c == 'H')f++;
    else if(f == 1){
      if(c == 'o')f++;
      else f = -1;
    }else if(f == 2){
      if(c == 's')f++;
      else f = -1;
    }else if(f == 3){
      if(c == 'h')f++;
      else f = -1;
    }else if(f == 4){
      if(c == 'i')f++;
      else f = -1;
    }else if(f == 5){
      if(c == 'n')f++;
      else f = -1;
    }else if(f == 6){
      if(c == 'o'){
	tmp = getchar();
	if(tmp == '\n' || tmp == ' ')putchar('a');
	else putchar(c);
	c = tmp;
      }
      f = -1;
    }

    if(c == '\n'){
      n--;
      f = 0;
    }else if(c == ' ')f = 0;

    putchar(c);
  }
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,b,n) for(int i=b;i<n;i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int n;
string str;
int main(){
	cin>>n;
	cin.ignore();
	string h  ="Hoshina";
	int pos = 0;
	for(int i = 0;i < n;i++){
		getline(cin,str);
		while(str.find("Hoshino")!=string::npos){
			pos = str.find("Hoshino");
			str.replace(pos,h.length(),h);
		}
		cout <<str<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int n;
	string s;
	string d="Hoshina";
	cin>>n;
	while(n--){
		while(getline(cin,s)!="\n");
		while(1){
			unsigned int loc = s.find("Hoshino");
			if(loc!=string::npos)
			s.replace(loc,d.size(),d);
			else
				break;
		}
		cout<<s<<endl;
	}
}