def main():
    n = int(input())
    Mtx = list(map(int, input().split()))
    
    showMtx(Mtx)
    for i in range(1,n):
        for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
        showMtx(Mtx)
                

def showMtx(Mtx):    
    q = len(Mtx)
    for i in range(q):
        if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i])



if __name__ == '__main__':
    main()
 def main():
    n = int(input())
    Mtx = list(map(int, input().split()))
    
    showMtx(Mtx)
    for i in range(1,n):
        for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
        showMtx(Mtx)
                 main n = int(input()) n int(input()) int input() input Mtx = list(map(int, input().split())) Mtx list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split showMtx(Mtx) showMtx Mtx for i in range(1,n):
        for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
        showMtx(Mtx)
                 i range(1,n) range 1 n for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
         j range(i,0,-1) range i 0 -1 if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
         Mtx[j] < Mtx[j-1] Mtx[j] Mtx j Mtx[j-1] Mtx j-1 j 1 Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1] Mtx[j-1] Mtx j-1 j 1 Mtx[j] Mtx j Mtx[j] Mtx j Mtx[j-1] Mtx j-1 j 1 showMtx(Mtx) showMtx Mtx def showMtx(Mtx):    
    q = len(Mtx)
    for i in range(q):
        if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i]) showMtx q = len(Mtx) q len(Mtx) len Mtx for i in range(q):
        if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i]) i range(q) range q if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i]) i != q - 1 i q - 1 q 1 print(Mtx[i], sep=' ', end=' ') print Mtx[i] Mtx i sep=' ' sep ' ' end=' ' end ' ' print(Mtx[i]) print Mtx[i] Mtx i Mtx Mtx if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    Mtx = list(map(int, input().split()))
    
    showMtx(Mtx)
    for i in range(1,n):
        for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
        showMtx(Mtx)
                 def main():
    n = int(input())
    Mtx = list(map(int, input().split()))
    
    showMtx(Mtx)
    for i in range(1,n):
        for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
        showMtx(Mtx)
                 main def showMtx(Mtx):    
    q = len(Mtx)
    for i in range(q):
        if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i]) def showMtx(Mtx):    
    q = len(Mtx)
    for i in range(q):
        if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i]) showMtx
def main():
    n = int(input())
    Mtx = list(map(int, input().split()))
    
    showMtx(Mtx)
    for i in range(1,n):
        for j in range(i,0,-1):
            if Mtx[j] < Mtx[j-1]:
                Mtx[j-1], Mtx[j] = Mtx[j], Mtx[j-1]
            # print(i, j, sep=', ')
        showMtx(Mtx)
                

def showMtx(Mtx):    
    q = len(Mtx)
    for i in range(q):
        if i != q - 1:
            print(Mtx[i], sep=' ', end=' ')
        else:
            print(Mtx[i])



if __name__ == '__main__':
    main()

