n = int(input())

for __ in range(n):
    sentence = input()
    length = 0

    while True:
        try:
            sentence[length]
            length += 1
        except:
            break
    
    for i in range(length-6):
        if sentence[i] == "H":
            if sentence[i+1] == "o":
                if sentence[i+2] == "s":
                    if sentence[i+3] == "h":
                        if sentence[i+4] == "i":
                            if sentence[i+5] == "n":
                                if sentence[i+6] == "o":
                                    after = ""
                                    for j in range(i+6):
                                        after += sentence[j]
                                    after += "a"
                                    for j in range(i+7,length):
                                        after += sentence[j]
                                    sentence = after

    print(sentence)
