N=int(input())
A=[int(i) for i in input().split()]
S=""
for i in range(N-1):
    S=S+str(A[i])+" "
S=S+str(A[N-1])
print(S)
for i in range(1,N):
    v=A[i]
    j=i-1
    while(j>=0 and A[j]>v):
        A[j+1]=A[j]
        j-=1
    A[j+1]=v
    S=""
    for i in range(N-1):
        S=S+str(A[i])+" "
    S=S+str(A[N-1])
    print(S) N=int(input()) N int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A=[int(i) for i in input().split()] A [int(i) for i in input().split()] S="" S "" for i in range(N-1):
    S=S+str(A[i])+" " i range(N-1) range N-1 N 1 S=S+str(A[i])+" " S S+str(A[i])+" " S+str(A[i]) S str(A[i]) str A[i] A i " " S=S+str(A[N-1]) S S+str(A[N-1]) S str(A[N-1]) str A[N-1] A N-1 N 1 print(S) print S for i in range(1,N):
    v=A[i]
    j=i-1
    while(j>=0 and A[j]>v):
        A[j+1]=A[j]
        j-=1
    A[j+1]=v
    S=""
    for i in range(N-1):
        S=S+str(A[i])+" "
    S=S+str(A[N-1])
    print(S) 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 A[j]>v):
        A[j+1]=A[j]
        j-=1
     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 S="" S "" for i in range(N-1):
        S=S+str(A[i])+" "
     i range(N-1) range N-1 N 1 S=S+str(A[i])+" " S S+str(A[i])+" " S+str(A[i]) S str(A[i]) str A[i] A i " " S=S+str(A[N-1]) S S+str(A[N-1]) S str(A[N-1]) str A[N-1] A N-1 N 1 print(S) print S N=int(input()) int(input()) N S=S+str(A[N-1]) S+str(A[N-1]) S S=S+str(A[i])+" " S+str(A[i])+" " S S=S+str(A[N-1]) S+str(A[N-1]) S j=i-1 i-1 j S=S+str(A[i])+" " S+str(A[i])+" " S S="" "" S S="" "" S v=A[i] A[i] v A=[int(i) for i in input().split()] [int(i) for i in input().split()] A j-=1 1 j
N=int(input())
A=[int(i) for i in input().split()]
S=""
for i in range(N-1):
    S=S+str(A[i])+" "
S=S+str(A[N-1])
print(S)
for i in range(1,N):
    v=A[i]
    j=i-1
    while(j>=0 and A[j]>v):
        A[j+1]=A[j]
        j-=1
    A[j+1]=v
    S=""
    for i in range(N-1):
        S=S+str(A[i])+" "
    S=S+str(A[N-1])
    print(S)
