#! /usr/bin/env python
#-*- coding: utf-8 -*-

''' ?????\????????? '''

#
# ?¨??????????O()


def insertion_sort(A, N):

    for i in range(N):
        tmp = A[i]
        j = i - 1

        while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = tmp

        print(' '.join(map(str, A)))

    return A


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    # N = 6
    # A = [5, 2, 4, 6, 1, 3]
    array_sorted = insertion_sort(A, N) ''' ?????\????????? ''' def insertion_sort(A, N):

    for i in range(N):
        tmp = A[i]
        j = i - 1

        while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = tmp

        print(' '.join(map(str, A)))

    return A insertion_sort for i in range(N):
        tmp = A[i]
        j = i - 1

        while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = tmp

        print(' '.join(map(str, A)))

     i range(N) range N tmp = A[i] tmp A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
         j >= 0 and A[j] > tmp j >= 0 j 0 A[j] > tmp A[j] A j tmp A[j + 1] = A[j] A[j + 1] A j + 1 j 1 A[j] A j j -= 1 j 1 A[j + 1] = tmp A[j + 1] A j + 1 j 1 tmp print(' '.join(map(str, A))) print ' '.join(map(str, A)) ' '.join ' ' join map(str, A) map str A return A A A A N N if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    # N = 6
    # A = [5, 2, 4, 6, 1, 3]
    array_sorted = insertion_sort(A, N) __name__ == "__main__" __name__ "__main__" N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split array_sorted = insertion_sort(A, N) array_sorted insertion_sort(A, N) insertion_sort A N array_sorted = insertion_sort(A, N) insertion_sort(A, N) array_sorted A = list(map(int, input().split())) list(map(int, input().split())) A def insertion_sort(A, N):

    for i in range(N):
        tmp = A[i]
        j = i - 1

        while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = tmp

        print(' '.join(map(str, A)))

    return A def insertion_sort(A, N):

    for i in range(N):
        tmp = A[i]
        j = i - 1

        while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = tmp

        print(' '.join(map(str, A)))

    return A insertion_sort N = int(input()) int(input()) N
#! /usr/bin/env python
#-*- coding: utf-8 -*-

''' ?????\????????? '''

#
# ?¨??????????O()


def insertion_sort(A, N):

    for i in range(N):
        tmp = A[i]
        j = i - 1

        while j >= 0 and A[j] > tmp:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = tmp

        print(' '.join(map(str, A)))

    return A


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    # N = 6
    # A = [5, 2, 4, 6, 1, 3]
    array_sorted = insertion_sort(A, N)