def insertion_sort(arr):
    print(" ".join(map(str, arr)))
    for i in range(1,len(arr)):
        j = i
        while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
        print(" ".join(map(str, arr)))

input()
arr = list(map(int, input().split()))
insertion_sort(arr) def insertion_sort(arr):
    print(" ".join(map(str, arr)))
    for i in range(1,len(arr)):
        j = i
        while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
        print(" ".join(map(str, arr))) insertion_sort print(" ".join(map(str, arr))) print " ".join(map(str, arr)) " ".join " " join map(str, arr) map str arr for i in range(1,len(arr)):
        j = i
        while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
        print(" ".join(map(str, arr))) i range(1,len(arr)) range 1 len(arr) len arr j = i j i while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
         arr[j] < arr[j-1] and j > 0 arr[j] < arr[j-1] arr[j] arr j arr[j-1] arr j-1 j 1 j > 0 j 0 arr[j-1], arr[j] = arr[j], arr[j-1] arr[j-1] arr j-1 j 1 arr[j] arr j arr[j] arr j arr[j-1] arr j-1 j 1 j -= 1 j 1 print(" ".join(map(str, arr))) print " ".join(map(str, arr)) " ".join " " join map(str, arr) map str arr arr arr input() input arr = list(map(int, input().split())) arr list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertion_sort(arr) insertion_sort arr arr = list(map(int, input().split())) list(map(int, input().split())) arr def insertion_sort(arr):
    print(" ".join(map(str, arr)))
    for i in range(1,len(arr)):
        j = i
        while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
        print(" ".join(map(str, arr))) def insertion_sort(arr):
    print(" ".join(map(str, arr)))
    for i in range(1,len(arr)):
        j = i
        while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
        print(" ".join(map(str, arr))) insertion_sort
def insertion_sort(arr):
    print(" ".join(map(str, arr)))
    for i in range(1,len(arr)):
        j = i
        while arr[j] < arr[j-1] and j > 0:
            arr[j-1], arr[j] = arr[j], arr[j-1]
            j -= 1
        print(" ".join(map(str, arr)))

input()
arr = list(map(int, input().split()))
insertion_sort(arr)
