n = int(input())
A = []
s = input()
A = list(map(int,s.split()))
for i in range(1,len(A)):
    v = A[i]
    j = i-1

    for k in range(0,len(A)-1):
        print(A[k],end=" ")
    print(A[len(A)-1])

    while(j >= 0 and A[j] > v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v

for k in range(0,len(A)-1):
    print(A[k],end=" ")
print(A[len(A)-1]) n = int(input()) n int(input()) int input() input A = [] A [] s = input() s input() input A = list(map(int,s.split())) A list(map(int,s.split())) list map(int,s.split()) map int s.split() s.split s split for i in range(1,len(A)):
    v = A[i]
    j = i-1

    for k in range(0,len(A)-1):
        print(A[k],end=" ")
    print(A[len(A)-1])

    while(j >= 0 and A[j] > v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v i range(1,len(A)) range 1 len(A) len A v = A[i] v A[i] A i j = i-1 j i-1 i 1 for k in range(0,len(A)-1):
        print(A[k],end=" ")
     k range(0,len(A)-1) range 0 len(A)-1 len(A) len A 1 print(A[k],end=" ") print A[k] A k end=" " end " " print(A[len(A)-1]) print A[len(A)-1] A len(A)-1 len(A) len A 1 while(j >= 0 and A[j] > v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v j >= 0 and A[j] > v j >= 0 j 0 A[j] > v A[j] A j v A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = v A[j+1] A j+1 j 1 v for k in range(0,len(A)-1):
    print(A[k],end=" ") k range(0,len(A)-1) range 0 len(A)-1 len(A) len A 1 print(A[k],end=" ") print A[k] A k end=" " end " " print(A[len(A)-1]) print A[len(A)-1] A len(A)-1 len(A) len A 1 n = int(input()) int(input()) n s = input() input() s v = A[i] A[i] v j -= 1 1 j j = i-1 i-1 j A = list(map(int,s.split())) list(map(int,s.split())) A A = [] [] A
n = int(input())
A = []
s = input()
A = list(map(int,s.split()))
for i in range(1,len(A)):
    v = A[i]
    j = i-1

    for k in range(0,len(A)-1):
        print(A[k],end=" ")
    print(A[len(A)-1])

    while(j >= 0 and A[j] > v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v

for k in range(0,len(A)-1):
    print(A[k],end=" ")
print(A[len(A)-1])