def main():
    N = int(input())
    L = list(map(int, input().split()))

    for i in range(1, N):
        print(*L)
        tmp = L[i]
        j = i
        while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
        L[j] = tmp

    print(*L)


if __name__ == '__main__':
    main() def main():
    N = int(input())
    L = list(map(int, input().split()))

    for i in range(1, N):
        print(*L)
        tmp = L[i]
        j = i
        while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
        L[j] = tmp

    print(*L) main N = int(input()) N int(input()) int input() input L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(1, N):
        print(*L)
        tmp = L[i]
        j = i
        while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
        L[j] = tmp

     i range(1, N) range 1 N print(*L) print *L L tmp = L[i] tmp L[i] L i j = i j i while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
         j > 0 and L[j-1] > tmp j > 0 j 0 L[j-1] > tmp L[j-1] L j-1 j 1 tmp L[j] = L[j-1] L[j] L j L[j-1] L j-1 j 1 j -= 1 j 1 L[j] = tmp L[j] L j tmp print(*L) print *L L if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    L = list(map(int, input().split()))

    for i in range(1, N):
        print(*L)
        tmp = L[i]
        j = i
        while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
        L[j] = tmp

    print(*L) def main():
    N = int(input())
    L = list(map(int, input().split()))

    for i in range(1, N):
        print(*L)
        tmp = L[i]
        j = i
        while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
        L[j] = tmp

    print(*L) main
def main():
    N = int(input())
    L = list(map(int, input().split()))

    for i in range(1, N):
        print(*L)
        tmp = L[i]
        j = i
        while j > 0 and L[j-1] > tmp:
            L[j] = L[j-1]
            j -= 1
        L[j] = tmp

    print(*L)


if __name__ == '__main__':
    main()
