#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys
import io
import re
import math
import itertools
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
#start = time.clock()
n=int(raw_input())
a=map(int,raw_input().split())
ans=chk=0
def prin(l):
    for i in l:
        print i,
    print

prin(a)
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
    prin(a) import time time import sys sys import io io import re re import math math import itertools itertools mod=1000000007 mod 1000000007 pi=3.141592653589 pi 3.141592653589 xy=[(1,0),(-1,0),(0,1),(0,-1)] xy [(1,0),(-1,0),(0,1),(0,-1)] (1,0) 1 0 (-1,0) -1 0 (0,1) 0 1 (0,-1) 0 -1 bs=[(-1,-1),(-1,1),(1,1),(1,-1)] bs [(-1,-1),(-1,1),(1,1),(1,-1)] (-1,-1) -1 -1 (-1,1) -1 1 (1,1) 1 1 (1,-1) 1 -1 n=int(raw_input()) n int(raw_input()) int raw_input() raw_input a=map(int,raw_input().split()) a map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split ans=chk=0 ans 0 =chk=0 chk 0 def prin(l):
    for i in l:
        print i,
    print prin for i in l:
        print i,
     i l print i print l l prin(a) prin a 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
    prin(a) 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 prin(a) prin a chk=0 0 chk ans=chk=0 0 ans j=i-1 i-1 j bs=[(-1,-1),(-1,1),(1,1),(1,-1)] [(-1,-1),(-1,1),(1,1),(1,-1)] bs v=a[i] a[i] v xy=[(1,0),(-1,0),(0,1),(0,-1)] [(1,0),(-1,0),(0,1),(0,-1)] xy a=map(int,raw_input().split()) map(int,raw_input().split()) a def prin(l):
    for i in l:
        print i,
    print def prin(l):
    for i in l:
        print i,
    print prin j-=1 1 j mod=1000000007 1000000007 mod pi=3.141592653589 3.141592653589 pi n=int(raw_input()) int(raw_input()) n
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys
import io
import re
import math
import itertools
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
#start = time.clock()
n=int(raw_input())
a=map(int,raw_input().split())
ans=chk=0
def prin(l):
    for i in l:
        print i,
    print

prin(a)
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
    prin(a)