def insertionSort(lis,leng):
    for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

        
if __name__ == "__main__":
    lengg=int(input())
    liss=list(map(int, input().split()))
    insertionSort(liss,lengg) def insertionSort(lis,leng):
    for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

         insertionSort for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

         i range(leng) range leng v = lis[i] v lis[i] lis i j = i - 1 j i - 1 i 1 while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
         j >= 0 and lis[j] > v j >= 0 j 0 lis[j] > v lis[j] lis j v lis[j+1] = lis[j] lis[j+1] lis j+1 j 1 lis[j] lis j j = j-1 j j-1 j 1 lis[j+1]=v lis[j+1] lis j+1 j 1 v print(*lis) print *lis lis lis lis leng leng if __name__ == "__main__":
    lengg=int(input())
    liss=list(map(int, input().split()))
    insertionSort(liss,lengg) __name__ == "__main__" __name__ "__main__" lengg=int(input()) lengg int(input()) int input() input liss=list(map(int, input().split())) liss list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertionSort(liss,lengg) insertionSort liss lengg liss=list(map(int, input().split())) list(map(int, input().split())) liss def insertionSort(lis,leng):
    for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

         def insertionSort(lis,leng):
    for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

         insertionSort lengg=int(input()) int(input()) lengg
def insertionSort(lis,leng):
    for i in range(leng):
        v = lis[i]
        j = i - 1
        while j >= 0 and lis[j] > v:
            lis[j+1] = lis[j]
            j = j-1
        lis[j+1]=v
        print(*lis)

        
if __name__ == "__main__":
    lengg=int(input())
    liss=list(map(int, input().split()))
    insertionSort(liss,lengg)