N = int(input())
A = list(map(int, input().split(" ")))

def print_list(A):
    for a in A[:-1]:
        print ("%d "%a, end="")
    print(A[-1])

def InsertionSort(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)

InsertionSort(A, 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 " " def print_list(A):
    for a in A[:-1]:
        print ("%d "%a, end="")
    print(A[-1]) print_list for a in A[:-1]:
        print ("%d "%a, end="")
     a A[:-1] A :-1 -1 print ("%d "%a, end="") print "%d "%a "%d " a end="" end "" print(A[-1]) print A[-1] A -1 A A def InsertionSort(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) InsertionSort 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 InsertionSort(A, N) InsertionSort A N def print_list(A):
    for a in A[:-1]:
        print ("%d "%a, end="")
    print(A[-1]) def print_list(A):
    for a in A[:-1]:
        print ("%d "%a, end="")
    print(A[-1]) print_list N = int(input()) int(input()) N A = list(map(int, input().split(" "))) list(map(int, input().split(" "))) A def InsertionSort(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 InsertionSort(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) InsertionSort
N = int(input())
A = list(map(int, input().split(" ")))

def print_list(A):
    for a in A[:-1]:
        print ("%d "%a, end="")
    print(A[-1])

def InsertionSort(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)

InsertionSort(A, N)