# 配列の要素数
num = int(input())

# 配列
array = list(map(int, input().split()))

def print_array():
    for i in range(num):
        if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort
for i in range(num):
    insert = array[i]
    j = 0
    while array[j] < insert:
        j+=1
    for k in range(i, j, -1):
        array[k] = array[k - 1]
    array[j] = insert
    print_array()
 num = int(input()) num int(input()) int input() input array = list(map(int, input().split())) array list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def print_array():
    for i in range(num):
        if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort print_array for i in range(num):
        if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort i range(num) range num if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort i != num-1 i num-1 num 1 print(array[i], end=' ') print array[i] array i end=' ' end ' ' print(array[i]) print array[i] array i for i in range(num):
    insert = array[i]
    j = 0
    while array[j] < insert:
        j+=1
    for k in range(i, j, -1):
        array[k] = array[k - 1]
    array[j] = insert
    print_array() i range(num) range num insert = array[i] insert array[i] array i j = 0 j 0 while array[j] < insert:
        j+=1
     array[j] < insert array[j] array j insert j+=1 j 1 for k in range(i, j, -1):
        array[k] = array[k - 1]
     k range(i, j, -1) range i j -1 array[k] = array[k - 1] array[k] array k array[k - 1] array k - 1 k 1 array[j] = insert array[j] array j insert print_array() print_array array = list(map(int, input().split())) list(map(int, input().split())) array def print_array():
    for i in range(num):
        if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort def print_array():
    for i in range(num):
        if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort print_array num = int(input()) int(input()) num insert = array[i] array[i] insert j+=1 1 j j = 0 0 j
# 配列の要素数
num = int(input())

# 配列
array = list(map(int, input().split()))

def print_array():
    for i in range(num):
        if i != num-1:
            print(array[i], end=' ')
        else:
            print(array[i])


# insertion sort
for i in range(num):
    insert = array[i]
    j = 0
    while array[j] < insert:
        j+=1
    for k in range(i, j, -1):
        array[k] = array[k - 1]
    array[j] = insert
    print_array()

