length=int(input())
firstArray=input()
listForArray=list(map(int,firstArray.split()))
listForPrint=[firstArray]


def insertionSort(list,length):
    index=1
    while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main-------------------------
insertionSort(listForArray,length)
for array in listForPrint:
    print(array) length=int(input()) length int(input()) int input() input firstArray=input() firstArray input() input listForArray=list(map(int,firstArray.split())) listForArray list(map(int,firstArray.split())) list map(int,firstArray.split()) map int firstArray.split() firstArray.split firstArray split listForPrint=[firstArray] listForPrint [firstArray] firstArray def insertionSort(list,length):
    index=1
    while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main------------------------- insertionSort index=1 index 1 while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main------------------------- index<length index length if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
         listForArray[index]<=listForArray[index-1] listForArray[index] listForArray index listForArray[index-1] listForArray index-1 index 1 for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
         index2 range(0,index) range 0 index if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
         listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2] listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] listForArray[index2-1]<=listForArray[index] listForArray[index2-1] listForArray index2-1 index2 1 listForArray[index] listForArray index listForArray[index]<=listForArray[index2] listForArray[index] listForArray index listForArray[index2] listForArray index2 index2==0 and listForArray[index]<=listForArray[index2] index2==0 index2 0 listForArray[index]<=listForArray[index2] listForArray[index] listForArray index listForArray[index2] listForArray index2 newCommer=listForArray[index] newCommer listForArray[index] listForArray index n=index n index while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                     n>index2 n index2 listForArray[n]=listForArray[n-1] listForArray[n] listForArray n listForArray[n-1] listForArray n-1 n 1 n-=1 n 1 listForArray[index2]=newCommer listForArray[index2] listForArray index2 newCommer break nowArray=str(listForArray[0]) nowArray str(listForArray[0]) str listForArray[0] listForArray 0 for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
         index3 range(1,length) range 1 length nowArray+=" "+str(listForArray[index3]) nowArray " "+str(listForArray[index3]) " " str(listForArray[index3]) str listForArray[index3] listForArray index3 listForPrint.append(nowArray) listForPrint.append listForPrint append nowArray index+=1 index 1 list list length length insertionSort(listForArray,length) insertionSort listForArray length for array in listForPrint:
    print(array) array listForPrint print(array) print array length=int(input()) int(input()) length def insertionSort(list,length):
    index=1
    while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main------------------------- def insertionSort(list,length):
    index=1
    while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main------------------------- insertionSort firstArray=input() input() firstArray listForArray=list(map(int,firstArray.split())) list(map(int,firstArray.split())) listForArray listForPrint=[firstArray] [firstArray] listForPrint
length=int(input())
firstArray=input()
listForArray=list(map(int,firstArray.split()))
listForPrint=[firstArray]


def insertionSort(list,length):
    index=1
    while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main-------------------------
insertionSort(listForArray,length)
for array in listForPrint:
    print(array)
