// Aizu Vol-1 0101: Aizu PR
// 2017.8.2

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define MAX  1000
char buf[MAX+5];
char *gets(char *);

#define HO "Hoshino"
#define HA "Hoshina"

myPuts(char *w, int n)
{
	while (n--) putchar(*w++);
}

int main()
{
	int i, n, k;
	char *p, *w;

	gets(buf), n = atoi(buf);
	for (i = 0; i < n; i++) {
		gets(p = buf);
		while (*p) {
			while (*p && !isalnum(*p)) putchar(*p++);
			if (!*p) break;
			w = p;
			while (isalnum(*p)) p++;
			if ((k = p - w) == 7 && !memcmp(w, HO, 7)) myPuts(HA, 7);
			else myPuts(w, k);
		}
		putchar('\n');
	}
	return 0;
}