using System;
using System.Linq;

namespace At
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] str = new string[N];
            for(int i = 0; i < N; i++)
            {
                string[] l = Console.ReadLine().Split();
                if (l[0] == "Hoshino")
                {
                    l[0] = "Hoshina";
                }
                str[i] += l[0];
                for (int j = 1; j < l.Length; j++)
                {
                    if(l[j]== "Hoshino")
                    {
                        l[j] = "Hoshina";
                    }
                    str[i] += " " + l[j];
                }
            }
            for(int i = 0; i < N; i++)
            {
                Console.WriteLine(str[i]);
            }
        }
    }
}