n = int(input())
A = input().split(' ')

#for i in range(n):
#    A[i] = int(A[i])
print(" ".join(A))

for i in range(1, n):
    v = A[i]
    j = i - 1

    while j >= 0 and int(A[j]) > int(v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v
    print(" ".join(A)) n = int(input()) n int(input()) int input() input A = input().split(' ') A input().split(' ') ().split () input split ' ' print(" ".join(A)) print " ".join(A) " ".join " " join A for i in range(1, n):
    v = A[i]
    j = i - 1

    while j >= 0 and int(A[j]) > int(v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v
    print(" ".join(A)) i range(1, n) range 1 n v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and int(A[j]) > int(v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v
     j >= 0 and int(A[j]) > int(v) j >= 0 j 0 int(A[j]) > int(v) int(A[j]) int A[j] A j int(v) int 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 print(" ".join(A)) print " ".join(A) " ".join " " join A A = input().split(' ') input().split(' ') A v = A[i] A[i] v j -= 1 1 j j = i - 1 i - 1 j n = int(input()) int(input()) n
n = int(input())
A = input().split(' ')

#for i in range(n):
#    A[i] = int(A[i])
print(" ".join(A))

for i in range(1, n):
    v = A[i]
    j = i - 1

    while j >= 0 and int(A[j]) > int(v):
        A[j+1] = A[j]
        j -= 1
        A[j+1] = v
    print(" ".join(A))