n = int(raw_input())
for i in range(n):
    inp = map(str, raw_input().split())
    for j in range(len(inp)):
        if inp[j][:7] == "Hoshino":
            inp[j] = "Hoshina" + inp[j][7:]
        elif inp[j][:8] == "Hoshino":
            inp[j] = inp[j][:7] + "a" + inp[j][8:]
    print " ".join(map(str, inp))
    