def insertionSort(A,N):
    for i in range(0,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(*A, sep=" ")

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

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