n = int(input())
input_list = [int(x) for x in input().split()]

def sort_print(n, input_list):
    # index[0]~ [n-1]?????§?¨??????????
    # ???????????????index??\???????????\?????°???????????°?????\????????????print???
    for i in range(n):
        index = i

        num = input_list[index]
        while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
        input_list[index] = num

        result = [str(x) for x in input_list]
        print(' '.join(result))

sort_print(n, input_list) n = int(input()) n 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 input_list = [int(x) for x in input().split()] input_list [int(x) for x in input().split()] def sort_print(n, input_list):
    # index[0]~ [n-1]?????§?¨??????????
    # ???????????????index??\???????????\?????°???????????°?????\????????????print???
    for i in range(n):
        index = i

        num = input_list[index]
        while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
        input_list[index] = num

        result = [str(x) for x in input_list]
        print(' '.join(result)) sort_print for i in range(n):
        index = i

        num = input_list[index]
        while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
        input_list[index] = num

        result = [str(x) for x in input_list]
        print(' '.join(result)) i range(n) range n index = i index i num = input_list[index] num input_list[index] input_list index while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
         index-1 >=0 and input_list[index-1] > num index-1 >=0 index-1 index 1 0 input_list[index-1] > num input_list[index-1] input_list index-1 index 1 num input_list[index] = input_list[index-1] input_list[index] input_list index input_list[index-1] input_list index-1 index 1 index -= 1 index 1 input_list[index] = num input_list[index] input_list index num str(x) for x in input_list for x in input_list x input_list for x in input_list str(x) str x result = [str(x) for x in input_list] result [str(x) for x in input_list] print(' '.join(result)) print ' '.join(result) ' '.join ' ' join result n n input_list input_list sort_print(n, input_list) sort_print n input_list input_list = [int(x) for x in input().split()] [int(x) for x in input().split()] input_list n = int(input()) int(input()) n def sort_print(n, input_list):
    # index[0]~ [n-1]?????§?¨??????????
    # ???????????????index??\???????????\?????°???????????°?????\????????????print???
    for i in range(n):
        index = i

        num = input_list[index]
        while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
        input_list[index] = num

        result = [str(x) for x in input_list]
        print(' '.join(result)) def sort_print(n, input_list):
    # index[0]~ [n-1]?????§?¨??????????
    # ???????????????index??\???????????\?????°???????????°?????\????????????print???
    for i in range(n):
        index = i

        num = input_list[index]
        while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
        input_list[index] = num

        result = [str(x) for x in input_list]
        print(' '.join(result)) sort_print
n = int(input())
input_list = [int(x) for x in input().split()]

def sort_print(n, input_list):
    # index[0]~ [n-1]?????§?¨??????????
    # ???????????????index??\???????????\?????°???????????°?????\????????????print???
    for i in range(n):
        index = i

        num = input_list[index]
        while index-1 >=0 and input_list[index-1] > num:
            input_list[index] = input_list[index-1]
            index -= 1
        input_list[index] = num

        result = [str(x) for x in input_list]
        print(' '.join(result))

sort_print(n, input_list)