let replace s =
  let len = String.length s in
  let rec loop s2 = function
      i when i = len -> s2
    | i ->
       if s2.[i] = 'H' then
         if i + 6 < len && String.sub s i 7 = "Hoshino" then
           begin
             Bytes.set s2 (i+6) 'a';
             loop s2 (i+7)
           end
         else loop s2 (i+1)
       else
         loop s2 (i+1)
  in loop s 0
;;

let () =
  let n = read_int () in
  for i = 0 to n-1 do
    Printf.printf "%s\n" (read_line () |> replace)
  done
;;