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

result_list = []
result_list.append(A[:])

for i in range(1,len(A)):
    key = A[i]
    j = i -1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = key
    result_list.append(A[:])

for i in range(n):
    if i > len(result_list):
        print(' '.join(str(n) for n in result_list[-1]))
    print(' '.join(str(n) for n in result_list[i])) 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 result_list = [] result_list [] result_list.append(A[:]) result_list.append result_list append A[:] A : for i in range(1,len(A)):
    key = A[i]
    j = i -1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = key
    result_list.append(A[:]) i range(1,len(A)) range 1 len(A) len A key = A[i] key A[i] A i j = i -1 j i -1 i 1 while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1
     j >= 0 and A[j] > key j >= 0 j 0 A[j] > key A[j] A j key A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = key A[j+1] A j+1 j 1 key result_list.append(A[:]) result_list.append result_list append A[:] A : for i in range(n):
    if i > len(result_list):
        print(' '.join(str(n) for n in result_list[-1]))
    print(' '.join(str(n) for n in result_list[i])) i range(n) range n if i > len(result_list):
        print(' '.join(str(n) for n in result_list[-1]))
     i > len(result_list) i len(result_list) len result_list print(' '.join(str(n) for n in result_list[-1])) print ' '.join(str(n) for n in result_list[-1]) ' '.join ' ' join str(n) str n print(' '.join(str(n) for n in result_list[i])) print ' '.join(str(n) for n in result_list[i]) ' '.join ' ' join str(n) str n j = i -1 i -1 j j -= 1 1 j result_list = [] [] result_list A = list(map(int, input().split())) list(map(int, input().split())) A key = A[i] A[i] key n = int(input()) int(input()) n
n = int(input())
A = list(map(int, input().split()))

result_list = []
result_list.append(A[:])

for i in range(1,len(A)):
    key = A[i]
    j = i -1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = key
    result_list.append(A[:])

for i in range(n):
    if i > len(result_list):
        print(' '.join(str(n) for n in result_list[-1]))
    print(' '.join(str(n) for n in result_list[i]))