def show (nums):
    for i in range(len(nums)):
        if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
 
n=int(input())
nums=list(map(int,input().split()))
show(nums)
for i in range(1,n):
    v=nums[i]
    j=i-1
    while (j>=0 and nums[j]>v):
        nums[j+1]=nums[j]
        j-=1
    nums[j+1]=v
    show(nums) def show (nums):
    for i in range(len(nums)):
        if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
  show for i in range(len(nums)):
        if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
  i range(len(nums)) range len(nums) len nums if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
  i!=len(nums)-1 i len(nums)-1 len(nums) len nums 1 print(nums[i],end=' ') print nums[i] nums i end=' ' end ' ' print(nums[i]) print nums[i] nums i nums nums n=int(input()) n int(input()) int input() input nums=list(map(int,input().split())) nums list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split show(nums) show nums for i in range(1,n):
    v=nums[i]
    j=i-1
    while (j>=0 and nums[j]>v):
        nums[j+1]=nums[j]
        j-=1
    nums[j+1]=v
    show(nums) i range(1,n) range 1 n v=nums[i] v nums[i] nums i j=i-1 j i-1 i 1 while (j>=0 and nums[j]>v):
        nums[j+1]=nums[j]
        j-=1
     j>=0 and nums[j]>v j>=0 j 0 nums[j]>v nums[j] nums j v nums[j+1]=nums[j] nums[j+1] nums j+1 j 1 nums[j] nums j j-=1 j 1 nums[j+1]=v nums[j+1] nums j+1 j 1 v show(nums) show nums j=i-1 i-1 j v=nums[i] nums[i] v nums=list(map(int,input().split())) list(map(int,input().split())) nums j-=1 1 j def show (nums):
    for i in range(len(nums)):
        if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
  def show (nums):
    for i in range(len(nums)):
        if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
  show n=int(input()) int(input()) n
def show (nums):
    for i in range(len(nums)):
        if i!=len(nums)-1:
            print(nums[i],end=' ')
        else :
            print(nums[i])
 
n=int(input())
nums=list(map(int,input().split()))
show(nums)
for i in range(1,n):
    v=nums[i]
    j=i-1
    while (j>=0 and nums[j]>v):
        nums[j+1]=nums[j]
        j-=1
    nums[j+1]=v
    show(nums)
