def insertion(A,n):
  for i in range(0,n):
    tmp = A[i]
    j = i - 1
    while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
    A[j+1] = tmp
    printList(A)


def printList(A):
  print(" ".join(str(x) for x in A))

n = int(input())
A = [int(x) for x in input().split()]
insertion(A,n) def insertion(A,n):
  for i in range(0,n):
    tmp = A[i]
    j = i - 1
    while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
    A[j+1] = tmp
    printList(A) insertion for i in range(0,n):
    tmp = A[i]
    j = i - 1
    while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
    A[j+1] = tmp
    printList(A) i range(0,n) range 0 n tmp = A[i] tmp A[i] A i j = i - 1 j i - 1 i 1 while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
     A[j] > tmp and j >= 0 A[j] > tmp A[j] A j tmp j >= 0 j 0 A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j-=1 j 1 A[j+1] = tmp A[j+1] A j+1 j 1 tmp printList(A) printList A A A n n def printList(A):
  print(" ".join(str(x) for x in A)) printList print(" ".join(str(x) for x in A)) print " ".join(str(x) for x in A) " ".join " " join str(x) str x A A n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x A = [int(x) for x in input().split()] A [int(x) for x in input().split()] insertion(A,n) insertion A n n = int(input()) int(input()) n def insertion(A,n):
  for i in range(0,n):
    tmp = A[i]
    j = i - 1
    while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
    A[j+1] = tmp
    printList(A) def insertion(A,n):
  for i in range(0,n):
    tmp = A[i]
    j = i - 1
    while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
    A[j+1] = tmp
    printList(A) insertion def printList(A):
  print(" ".join(str(x) for x in A)) def printList(A):
  print(" ".join(str(x) for x in A)) printList A = [int(x) for x in input().split()] [int(x) for x in input().split()] A
def insertion(A,n):
  for i in range(0,n):
    tmp = A[i]
    j = i - 1
    while(A[j] > tmp and j >= 0):
      A[j+1] = A[j]
      j-=1
    A[j+1] = tmp
    printList(A)


def printList(A):
  print(" ".join(str(x) for x in A))

n = int(input())
A = [int(x) for x in input().split()]
insertion(A,n)