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

using namespace std;

int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

	int n;
	string s;
	getline(cin, s);
	n = atoi(s.c_str());

	for(int i = 0; i < n; i++) {
		string str;
		getline(cin, str);
		cout << str.length() << endl;
		for(int j = 0; j <= str.length() - 7; j++) {
			string sub;
			sub = str.substr(j, 7);
			cout << sub << endl;
			if( sub == "Hoshino" )
				str[j + 6] = 'a';

			
		}
		cout << str << endl;
	}
	
 
	//while (1){}
	return 0;
}