#coding: utf-8

def print_list(X):
    first_frag = True
    for val in X:
        if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
    print(print_line)

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

print_list(A)

for i in range(1, N):
    tmp_val = A[i]
    j = i - 1
    while (j >= 0) and (tmp_val < A[j]):
        A[j+1] = A[j]
        j -= 1
    A[j+1] = tmp_val

    print_list(A) def print_list(X):
    first_frag = True
    for val in X:
        if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
    print(print_line) print_list first_frag = True first_frag True for val in X:
        if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
     val X if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
     first_frag print_line = str(val) print_line str(val) str val first_frag = False first_frag False print_line = print_line + ' ' + str(val) print_line print_line + ' ' + str(val) print_line + ' ' print_line ' ' str(val) str val print(print_line) print print_line X X N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print_list(A) print_list A for i in range(1, N):
    tmp_val = A[i]
    j = i - 1
    while (j >= 0) and (tmp_val < A[j]):
        A[j+1] = A[j]
        j -= 1
    A[j+1] = tmp_val

    print_list(A) i range(1, N) range 1 N tmp_val = A[i] tmp_val A[i] A i j = i - 1 j i - 1 i 1 while (j >= 0) and (tmp_val < A[j]):
        A[j+1] = A[j]
        j -= 1
     (j >= 0) and (tmp_val < A[j]) j >= 0 j 0 tmp_val < A[j] tmp_val A[j] A j A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = tmp_val A[j+1] A j+1 j 1 tmp_val print_list(A) print_list A N = int(input()) int(input()) N j -= 1 1 j def print_list(X):
    first_frag = True
    for val in X:
        if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
    print(print_line) def print_list(X):
    first_frag = True
    for val in X:
        if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
    print(print_line) print_list j = i - 1 i - 1 j tmp_val = A[i] A[i] tmp_val A = list(map(int, input().split())) list(map(int, input().split())) A
#coding: utf-8

def print_list(X):
    first_frag = True
    for val in X:
        if first_frag:
            print_line = str(val)
            first_frag = False
        else:
            print_line = print_line + ' ' + str(val)
    print(print_line)

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

print_list(A)

for i in range(1, N):
    tmp_val = A[i]
    j = i - 1
    while (j >= 0) and (tmp_val < A[j]):
        A[j+1] = A[j]
        j -= 1
    A[j+1] = tmp_val

    print_list(A)