using System;

namespace AOJ.Volume1
{
    class AizuPR
    {
        public static void Main()
        {
            int cnt = int.Parse(Console.ReadLine());
            for (int i = 0; i < cnt; i++)
            {
                var input = Console.ReadLine().Trim();
                int length = input.Length;
                for (int j = 0; j < length; j++)
                {
                    if (input[j] != 'H') { continue; }
                    j++;
                    if (input[j] != 'o') { continue; }
                    j++;
                    if (input[j] != 's') { continue; }
                    j++;
                    if (input[j] != 'h') { continue; }
                    j++;
                    if (input[j] != 'i') { continue; }
                    j++;
                    if (input[j] != 'n') { continue; }
                    j++;
                    if (input[j] != 'o') { continue; }
                    else
                    {
                        input = input.Remove(j, 1).Insert(j, "a");
                    }
                }
                Console.WriteLine(input);
            }
        }
    }
}