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(str(A).replace(",",'').replace("[",'').replace("]",''))


N=int(input())
sl=input()
print(sl)
lis=list(map(int,sl.split()))
insertionSort(lis,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(str(A).replace(",",'').replace("[",'').replace("]",'')) 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(str(A).replace(",",'').replace("[",'').replace("]",'')) 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(str(A).replace(",",'').replace("[",'').replace("]",'')) print str(A).replace(",",'').replace("[",'').replace("]",'') (A).replace(",",'').replace("[",'').replace (A).replace(",",'').replace("[",'') (A).replace(",",'').replace (A).replace(",",'') (A).replace (A) str A replace "," '' replace "[" '' replace "]" '' A A N N N=int(input()) N int(input()) int input() input sl=input() sl input() input print(sl) print sl lis=list(map(int,sl.split())) lis list(map(int,sl.split())) list map(int,sl.split()) map int sl.split() sl.split sl split insertionSort(lis,N) insertionSort lis N lis=list(map(int,sl.split())) list(map(int,sl.split())) lis N=int(input()) int(input()) N sl=input() input() sl 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(str(A).replace(",",'').replace("[",'').replace("]",'')) 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(str(A).replace(",",'').replace("[",'').replace("]",'')) insertionSort
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(str(A).replace(",",'').replace("[",'').replace("]",''))


N=int(input())
sl=input()
print(sl)
lis=list(map(int,sl.split()))
insertionSort(lis,N)