n=int(input())
a=input().split()
for i in range(n):
 k=int(a[i])
 j=i-1
 while j>=0 and int(a[j])>k:
  a[j+1]=a[j]
  j-=1
 a[j+1]=k
 print(*a) n=int(input()) n int(input()) int input() input a=input().split() a input().split() ().split () input split for i in range(n):
 k=int(a[i])
 j=i-1
 while j>=0 and int(a[j])>k:
  a[j+1]=a[j]
  j-=1
 a[j+1]=k
 print(*a) i range(n) range n k=int(a[i]) k int(a[i]) int a[i] a i j=i-1 j i-1 i 1 while j>=0 and int(a[j])>k:
  a[j+1]=a[j]
  j-=1
  j>=0 and int(a[j])>k j>=0 j 0 int(a[j])>k int(a[j]) int a[j] a j k a[j+1]=a[j] a[j+1] a j+1 j 1 a[j] a j j-=1 j 1 a[j+1]=k a[j+1] a j+1 j 1 k print(*a) print *a a j-=1 1 j k=int(a[i]) int(a[i]) k j=i-1 i-1 j n=int(input()) int(input()) n a=input().split() input().split() a
n=int(input())
a=input().split()
for i in range(n):
 k=int(a[i])
 j=i-1
 while j>=0 and int(a[j])>k:
  a[j+1]=a[j]
  j-=1
 a[j+1]=k
 print(*a)