#include <iostream>
#include <string>
#include <stdio.h>

#define N 1000

using namespace std;

int main()
{
	int n;
	int s;
	string str;

	cin >> n;

	for(int i = 1; i <= n*2-2; i++)
	{
		getline(cin,str);

		for(s = 0; s < N; s++){

		if(str[s] == 'H' && str[s+1] =='o' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o' 
			|| str[s] == 'H' && str[s+1] =='a' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o'){
			//str[s] = 'H';
			str[s+1] = 'o';
			//str[s+2] = 's';
			//str[s+3] = 'h';
			//str[s+4] = 'i';
			//str[s+5] = 'n';
			str[s+6] = 'a';

			
			//if(str[s] == '\0')
			//	str[s] == '\0';
			//s++;

		}

		}
		cout << str << endl;

	}
}