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

print(" ".join(list(map(str,a))))
def insertionSort(A,N):
    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(" ".join(list(map(str,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 print(" ".join(list(map(str,a)))) print " ".join(list(map(str,a))) " ".join " " join list(map(str,a)) list map(str,a) map str a def insertionSort(A,N):
    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(" ".join(list(map(str,A)))) insertionSort 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(" ".join(list(map(str,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(" ".join(list(map(str,A)))) print " ".join(list(map(str,A))) " ".join " " join list(map(str,A)) list map(str,A) map str A A A N N insertionSort(a,n) insertionSort a n def insertionSort(A,N):
    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(" ".join(list(map(str,A)))) def insertionSort(A,N):
    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(" ".join(list(map(str,A)))) insertionSort n = int(input()) int(input()) n a = list(map(int,input().split())) list(map(int,input().split())) a

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

print(" ".join(list(map(str,a))))
def insertionSort(A,N):
    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(" ".join(list(map(str,A))))

insertionSort(a,n)
