def print_list(A):
    print(*A, sep=" ")

def insertion_sort(A, n):
    print_list(A)
    for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print_list(A)

n = int(input())
A = list(map(int,input().split()))

insertion_sort(A, n) def print_list(A):
    print(*A, sep=" ") print_list print(*A, sep=" ") print *A A sep=" " sep " " A A def insertion_sort(A, n):
    print_list(A)
    for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print_list(A) insertion_sort print_list(A) print_list A for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print_list(A) i range(1, n) range 1 n v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
         j >= 0 and A[j] > v j >= 0 j 0 A[j] > v A[j] A j v A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = v A[j+1] A j+1 j 1 v print_list(A) print_list A A A n n n = int(input()) n int(input()) int input() input A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split insertion_sort(A, n) insertion_sort A n def print_list(A):
    print(*A, sep=" ") def print_list(A):
    print(*A, sep=" ") print_list def insertion_sort(A, n):
    print_list(A)
    for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print_list(A) def insertion_sort(A, n):
    print_list(A)
    for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print_list(A) insertion_sort A = list(map(int,input().split())) list(map(int,input().split())) A n = int(input()) int(input()) n
def print_list(A):
    print(*A, sep=" ")

def insertion_sort(A, n):
    print_list(A)
    for i in range(1, n):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print_list(A)

n = int(input())
A = list(map(int,input().split()))

insertion_sort(A, n)
