N=int(input())
a=list(map(int, input().split()))
k=list(map(str,a))
j=' '.join(k)
print(j)
for i in range(1,N):
    v=a[i]
    j=i-1
    while a[j]>v and j>=0:
        a[j+1]=a[j]
        j -=1
    a[j+1]=v
    b=list(map(str, a))
    c=' '.join(b)
    print(c) 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 k=list(map(str,a)) k list(map(str,a)) list map(str,a) map str a j=' '.join(k) j ' '.join(k) ' '.join ' ' join k print(j) print j for i in range(1,N):
    v=a[i]
    j=i-1
    while a[j]>v and j>=0:
        a[j+1]=a[j]
        j -=1
    a[j+1]=v
    b=list(map(str, a))
    c=' '.join(b)
    print(c) i range(1,N) range 1 N v=a[i] v a[i] a i j=i-1 j i-1 i 1 while a[j]>v and j>=0:
        a[j+1]=a[j]
        j -=1
     a[j]>v and j>=0 a[j]>v a[j] a j v j>=0 j 0 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 b=list(map(str, a)) b list(map(str, a)) list map(str, a) map str a c=' '.join(b) c ' '.join(b) ' '.join ' ' join b print(c) print c v=a[i] a[i] v c=' '.join(b) ' '.join(b) c j=i-1 i-1 j k=list(map(str,a)) list(map(str,a)) k b=list(map(str, a)) list(map(str, a)) b a=list(map(int, input().split())) list(map(int, input().split())) a j=' '.join(k) ' '.join(k) j j -=1 1 j N=int(input()) int(input()) N
N=int(input())
a=list(map(int, input().split()))
k=list(map(str,a))
j=' '.join(k)
print(j)
for i in range(1,N):
    v=a[i]
    j=i-1
    while a[j]>v and j>=0:
        a[j+1]=a[j]
        j -=1
    a[j+1]=v
    b=list(map(str, a))
    c=' '.join(b)
    print(c)
