#!/usr/bin/env python

def InsertSort(N,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(*A)


if __name__ == "__main__":
    N=int(input())
    arr=list(map(int,input().split()))
    print(*arr)
    InsertSort(N,arr) def InsertSort(N,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(*A) InsertSort 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(*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(*A) print *A A N N A A if __name__ == "__main__":
    N=int(input())
    arr=list(map(int,input().split()))
    print(*arr)
    InsertSort(N,arr) __name__ == "__main__" __name__ "__main__" N=int(input()) N int(input()) int input() input arr=list(map(int,input().split())) arr list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print(*arr) print *arr arr InsertSort(N,arr) InsertSort N arr N=int(input()) int(input()) N arr=list(map(int,input().split())) list(map(int,input().split())) arr def InsertSort(N,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(*A) def InsertSort(N,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(*A) InsertSort
#!/usr/bin/env python

def InsertSort(N,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(*A)


if __name__ == "__main__":
    N=int(input())
    arr=list(map(int,input().split()))
    print(*arr)
    InsertSort(N,arr)