
def insertion_sort(a, n):
    for i in range(0, n):

        value = a[i]
        j = i - 1
        while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
        a[j+1] = value

        # convert string to int.
        process_list = map(str, a)
        # join as string.
        print(" ".join(process_list))


num_length = int(input())
num_array = [int(x) for x in input().split()]

insertion_sort(num_array, num_length) def insertion_sort(a, n):
    for i in range(0, n):

        value = a[i]
        j = i - 1
        while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
        a[j+1] = value

        # convert string to int.
        process_list = map(str, a)
        # join as string.
        print(" ".join(process_list)) insertion_sort for i in range(0, n):

        value = a[i]
        j = i - 1
        while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
        a[j+1] = value

        # convert string to int.
        process_list = map(str, a)
        # join as string.
        print(" ".join(process_list)) i range(0, n) range 0 n value = a[i] value a[i] a i j = i - 1 j i - 1 i 1 while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
         j >= 0 and a[j] > value j >= 0 j 0 a[j] > value a[j] a j value a[j+1] = a[j] a[j+1] a j+1 j 1 a[j] a j j -= 1 j 1 a[j+1] = value a[j+1] a j+1 j 1 value process_list = map(str, a) process_list map(str, a) map str a print(" ".join(process_list)) print " ".join(process_list) " ".join " " join process_list a a n n num_length = int(input()) num_length int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x num_array = [int(x) for x in input().split()] num_array [int(x) for x in input().split()] insertion_sort(num_array, num_length) insertion_sort num_array num_length def insertion_sort(a, n):
    for i in range(0, n):

        value = a[i]
        j = i - 1
        while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
        a[j+1] = value

        # convert string to int.
        process_list = map(str, a)
        # join as string.
        print(" ".join(process_list)) def insertion_sort(a, n):
    for i in range(0, n):

        value = a[i]
        j = i - 1
        while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
        a[j+1] = value

        # convert string to int.
        process_list = map(str, a)
        # join as string.
        print(" ".join(process_list)) insertion_sort num_array = [int(x) for x in input().split()] [int(x) for x in input().split()] num_array num_length = int(input()) int(input()) num_length

def insertion_sort(a, n):
    for i in range(0, n):

        value = a[i]
        j = i - 1
        while j >= 0 and a[j] > value:
            a[j+1] = a[j]
            j -= 1
        a[j+1] = value

        # convert string to int.
        process_list = map(str, a)
        # join as string.
        print(" ".join(process_list))


num_length = int(input())
num_array = [int(x) for x in input().split()]

insertion_sort(num_array, num_length)