n = int(input())
for i in range(n):
    lst = input().split()
    ans = []
    for s in lst:
        if s.count("Hoshin"):
            ans.append("Hoshina")
        else:
            ans.append(s)
    # print(ans)
    for s in ans:
        if s == ans[-1]:
            print(s)
        else:
            print(s, end=" ")
