n = int(input())
for i in range(n):
    arr = list(input().split())
    for i in range(len(arr)):
        if arr[i] == 'Hoshino':
            arr[i] = 'Hoshina'
    for i in range(len(arr)-1):
        print(arr[i],end = ' ')
    print(arr[-1])