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())
a = list(map(int, input().split()))

for i in range(n):
    for j in range(i):
        if a[j] > a[i]:
            a.insert(j, a[i])
            a.pop(i+1)
            break
    show(a)
 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 a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(n):
    for j in range(i):
        if a[j] > a[i]:
            a.insert(j, a[i])
            a.pop(i+1)
            break
    show(a) i range(n) range n for j in range(i):
        if a[j] > a[i]:
            a.insert(j, a[i])
            a.pop(i+1)
            break
     j range(i) range i if a[j] > a[i]:
            a.insert(j, a[i])
            a.pop(i+1)
            break
     a[j] > a[i] a[j] a j a[i] a i a.insert(j, a[i]) a.insert a insert j a[i] a i a.pop(i+1) a.pop a pop i+1 i 1 break show(a) show a a = list(map(int, input().split())) list(map(int, input().split())) a 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())
a = list(map(int, input().split()))

for i in range(n):
    for j in range(i):
        if a[j] > a[i]:
            a.insert(j, a[i])
            a.pop(i+1)
            break
    show(a)

