def show_list(num_list):
    for i in range(len(num_list)):
        print(str(num_list[i]), end="")
        if i < len(num_list)-1:
            print(" ", end="")
        else:
            print()

input_num = int(input())
num_list = [int(i) for i in input().split()]
show_list(num_list)
for i in range(1, len(num_list)):
    v = num_list[i]
    j = i - 1
    while j >= 0 and num_list[j] > v:
        num_list[j+1] = num_list[j]
        j -= 1
    num_list[j+1] = v
    show_list(num_list) def show_list(num_list):
    for i in range(len(num_list)):
        print(str(num_list[i]), end="")
        if i < len(num_list)-1:
            print(" ", end="")
        else:
            print() show_list for i in range(len(num_list)):
        print(str(num_list[i]), end="")
        if i < len(num_list)-1:
            print(" ", end="")
        else:
            print() i range(len(num_list)) range len(num_list) len num_list print(str(num_list[i]), end="") print str(num_list[i]) str num_list[i] num_list i end="" end "" if i < len(num_list)-1:
            print(" ", end="")
        else:
            print() i < len(num_list)-1 i len(num_list)-1 len(num_list) len num_list 1 print(" ", end="") print " " end="" end "" print() print num_list num_list input_num = int(input()) input_num int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i num_list = [int(i) for i in input().split()] num_list [int(i) for i in input().split()] show_list(num_list) show_list num_list for i in range(1, len(num_list)):
    v = num_list[i]
    j = i - 1
    while j >= 0 and num_list[j] > v:
        num_list[j+1] = num_list[j]
        j -= 1
    num_list[j+1] = v
    show_list(num_list) i range(1, len(num_list)) range 1 len(num_list) len num_list v = num_list[i] v num_list[i] num_list i j = i - 1 j i - 1 i 1 while j >= 0 and num_list[j] > v:
        num_list[j+1] = num_list[j]
        j -= 1
     j >= 0 and num_list[j] > v j >= 0 j 0 num_list[j] > v num_list[j] num_list j v num_list[j+1] = num_list[j] num_list[j+1] num_list j+1 j 1 num_list[j] num_list j j -= 1 j 1 num_list[j+1] = v num_list[j+1] num_list j+1 j 1 v show_list(num_list) show_list num_list def show_list(num_list):
    for i in range(len(num_list)):
        print(str(num_list[i]), end="")
        if i < len(num_list)-1:
            print(" ", end="")
        else:
            print() def show_list(num_list):
    for i in range(len(num_list)):
        print(str(num_list[i]), end="")
        if i < len(num_list)-1:
            print(" ", end="")
        else:
            print() show_list j = i - 1 i - 1 j j -= 1 1 j num_list = [int(i) for i in input().split()] [int(i) for i in input().split()] num_list v = num_list[i] num_list[i] v input_num = int(input()) int(input()) input_num
def show_list(num_list):
    for i in range(len(num_list)):
        print(str(num_list[i]), end="")
        if i < len(num_list)-1:
            print(" ", end="")
        else:
            print()

input_num = int(input())
num_list = [int(i) for i in input().split()]
show_list(num_list)
for i in range(1, len(num_list)):
    v = num_list[i]
    j = i - 1
    while j >= 0 and num_list[j] > v:
        num_list[j+1] = num_list[j]
        j -= 1
    num_list[j+1] = v
    show_list(num_list)