s = int(input())
A = input().split()
for i in range(s):
    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)) s = int(input()) s int(input()) int input() input A = input().split() A input().split() ().split () input split for i in range(s):
    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(s) range s 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
     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 j = i - 1 i - 1 j s = int(input()) int(input()) s v = A[i] A[i] v j -= 1 1 j A = input().split() input().split() A
s = int(input())
A = input().split()
for i in range(s):
    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))