n = input()
a = map(int,raw_input().split())


print " ".join(map(str,a))
for i in xrange(1,len(a)):
  v = a[i]
  j = i - 1
  while j >= 0 and a[j] > v :
    a[j+1] = a[j]
    j = j - 1
  a[j+1] = v

  print " ".join(map(str,a)) n = input() n input() input a = map(int,raw_input().split()) a map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split print " ".join(map(str,a)) " ".join " " join map(str,a) map str a for i in xrange(1,len(a)):
  v = a[i]
  j = i - 1
  while j >= 0 and a[j] > v :
    a[j+1] = a[j]
    j = j - 1
  a[j+1] = v

  print " ".join(map(str,a)) i xrange(1,len(a)) xrange 1 len(a) len a 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 = 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 = j - 1 j j - 1 j 1 a[j+1] = v a[j+1] a j+1 j 1 v print " ".join(map(str,a)) " ".join " " join map(str,a) map str a n = input() input() n a = map(int,raw_input().split()) map(int,raw_input().split()) a j = i - 1 i - 1 j j = j - 1 j - 1 j v = a[i] a[i] v
n = input()
a = map(int,raw_input().split())


print " ".join(map(str,a))
for i in xrange(1,len(a)):
  v = a[i]
  j = i - 1
  while j >= 0 and a[j] > v :
    a[j+1] = a[j]
    j = j - 1
  a[j+1] = v

  print " ".join(map(str,a))