def insertionSort(A,input_num):
    for i in range(input_num):
        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(*A)
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num) def insertionSort(A,input_num):
    for i in range(input_num):
        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(*A)
         insertionSort for i in range(input_num):
        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(*A)
         i range(input_num) range input_num 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(*A) print *A A A A input_num input_num input_num = int(input()) input_num 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 insertionSort(A,input_num) insertionSort A input_num input_num = int(input()) int(input()) input_num def insertionSort(A,input_num):
    for i in range(input_num):
        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(*A)
         def insertionSort(A,input_num):
    for i in range(input_num):
        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(*A)
         insertionSort A = list(map(int, input().split())) list(map(int, input().split())) A
def insertionSort(A,input_num):
    for i in range(input_num):
        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(*A)
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num)
