using System;

namespace AOJ.Volume1
{
    class AizuPR
    {
        public static void Main()
        {
            while (true)
            {
                string line = Console.ReadLine();
                if (string.IsNullOrEmpty(line)) { break; }

                int cnt = int.Parse(line);
                for (int i = 1; i <= cnt; i++)
                {
                    var input = Console.ReadLine();
                    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);
                }
            }
        }
    }
}