def min_heapify(arr, start, simulation, iteration):
    end = len(arr) - 1
    last_parent = (end - start - 1) // 2
    for parent in range(last_parent, -1, -1):
        current_parent = parent
        while current_parent <= last_parent:
            child = 2 * current_parent + 1
            if child + 1 <= end - start and arr[child + start] > arr[
                child + 1 + start]:
                child = child + 1
            if arr[child + start] < arr[current_parent + start]:
                arr[current_parent + start], arr[child + start] = \
                    arr[child + start], arr[current_parent + start]
                current_parent = child
                if simulation:
                    iteration = iteration + 1
                    print("iteration",iteration,":",*arr)
            else:
                break
    return iteration