def print_list(ele_list):
    print(" ".join(map(str, ele_list)))

def insertion_sort(ele_list):
    len_ele_list = len(ele_list)
    print_list(ele_list)
    for i in range(1, len_ele_list):
        key = ele_list[i]
        j = i - 1
        while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
        ele_list[j+1] = key
        print_list(ele_list)

N = int(input())
ele_list = list(map(int, input().split()))

insertion_sort(ele_list) def print_list(ele_list):
    print(" ".join(map(str, ele_list))) print_list print(" ".join(map(str, ele_list))) print " ".join(map(str, ele_list)) " ".join " " join map(str, ele_list) map str ele_list ele_list ele_list def insertion_sort(ele_list):
    len_ele_list = len(ele_list)
    print_list(ele_list)
    for i in range(1, len_ele_list):
        key = ele_list[i]
        j = i - 1
        while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
        ele_list[j+1] = key
        print_list(ele_list) insertion_sort len_ele_list = len(ele_list) len_ele_list len(ele_list) len ele_list print_list(ele_list) print_list ele_list for i in range(1, len_ele_list):
        key = ele_list[i]
        j = i - 1
        while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
        ele_list[j+1] = key
        print_list(ele_list) i range(1, len_ele_list) range 1 len_ele_list key = ele_list[i] key ele_list[i] ele_list i j = i - 1 j i - 1 i 1 while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
         j >= 0 and ele_list[j] > key j >= 0 j 0 ele_list[j] > key ele_list[j] ele_list j key ele_list[j+1] = ele_list[j] ele_list[j+1] ele_list j+1 j 1 ele_list[j] ele_list j j -= 1 j 1 ele_list[j+1] = key ele_list[j+1] ele_list j+1 j 1 key print_list(ele_list) print_list ele_list ele_list ele_list N = int(input()) N int(input()) int input() input ele_list = list(map(int, input().split())) ele_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertion_sort(ele_list) insertion_sort ele_list def insertion_sort(ele_list):
    len_ele_list = len(ele_list)
    print_list(ele_list)
    for i in range(1, len_ele_list):
        key = ele_list[i]
        j = i - 1
        while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
        ele_list[j+1] = key
        print_list(ele_list) def insertion_sort(ele_list):
    len_ele_list = len(ele_list)
    print_list(ele_list)
    for i in range(1, len_ele_list):
        key = ele_list[i]
        j = i - 1
        while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
        ele_list[j+1] = key
        print_list(ele_list) insertion_sort N = int(input()) int(input()) N def print_list(ele_list):
    print(" ".join(map(str, ele_list))) def print_list(ele_list):
    print(" ".join(map(str, ele_list))) print_list ele_list = list(map(int, input().split())) list(map(int, input().split())) ele_list
def print_list(ele_list):
    print(" ".join(map(str, ele_list)))

def insertion_sort(ele_list):
    len_ele_list = len(ele_list)
    print_list(ele_list)
    for i in range(1, len_ele_list):
        key = ele_list[i]
        j = i - 1
        while j >= 0 and ele_list[j] > key:
            ele_list[j+1] = ele_list[j]
            j -= 1
        ele_list[j+1] = key
        print_list(ele_list)

N = int(input())
ele_list = list(map(int, input().split()))

insertion_sort(ele_list)