# coding: utf-8

def printls(ls):
    print(' '.join(map(str,ls)))
    
def main():
    trash = input()
    ls = list(map(int, input().split(' ')))

    for i in range(1, len(ls)):
        printls(ls)
        v = ls[i]
        for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

    printls(ls)
    
if __name__ == '__main__':
    main() def printls(ls):
    print(' '.join(map(str,ls)))
     printls print(' '.join(map(str,ls))) print ' '.join(map(str,ls)) ' '.join ' ' join map(str,ls) map str ls ls ls def main():
    trash = input()
    ls = list(map(int, input().split(' ')))

    for i in range(1, len(ls)):
        printls(ls)
        v = ls[i]
        for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

    printls(ls)
     main trash = input() trash input() input ls = list(map(int, input().split(' '))) ls list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' for i in range(1, len(ls)):
        printls(ls)
        v = ls[i]
        for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

     i range(1, len(ls)) range 1 len(ls) len ls printls(ls) printls ls v = ls[i] v ls[i] ls i for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

     j reversed(range(0, i)) reversed range(0, i) range 0 i if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

     ls[j] > v ls[j] ls j v ls[j], ls[j+1] = ls[j+1], ls[j] ls[j] ls j ls[j+1] ls j+1 j 1 ls[j+1] ls j+1 j 1 ls[j] ls j printls(ls) printls ls if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    trash = input()
    ls = list(map(int, input().split(' ')))

    for i in range(1, len(ls)):
        printls(ls)
        v = ls[i]
        for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

    printls(ls)
     def main():
    trash = input()
    ls = list(map(int, input().split(' ')))

    for i in range(1, len(ls)):
        printls(ls)
        v = ls[i]
        for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

    printls(ls)
     main def printls(ls):
    print(' '.join(map(str,ls)))
     def printls(ls):
    print(' '.join(map(str,ls)))
     printls
# coding: utf-8

def printls(ls):
    print(' '.join(map(str,ls)))
    
def main():
    trash = input()
    ls = list(map(int, input().split(' ')))

    for i in range(1, len(ls)):
        printls(ls)
        v = ls[i]
        for j in reversed(range(0, i)):
            if ls[j] > v:
                ls[j], ls[j+1] = ls[j+1], ls[j]

    printls(ls)
    
if __name__ == '__main__':
    main()