import sys

def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print

y = sys.stdin.readline()
y = int(y)

x = sys.stdin.readline()

x_list = x.split(" ")

for i in range(y):
  x_list[i] = int(x_list[i])

for k in range(0, y):
  print x_list[k],
print

insertionSort(x_list, y) import sys sys def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print insertionSort for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print i range(1, y) range 1 y v = x_list[i] v x_list[i] x_list i j = i - 1 j i - 1 i 1 while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
     j >= 0 and x_list[j] > v j >= 0 j 0 x_list[j] > v x_list[j] x_list j v x_list[j + 1] = x_list[j] x_list[j + 1] x_list j + 1 j 1 x_list[j] x_list j j -= 1 j 1 x_list[j+1] = v x_list[j+1] x_list j+1 j 1 v for k in range(0, y):
      print x_list[k],
     k range(0, y) range 0 y print x_list[k] x_list k print x_list x_list y y y = sys.stdin.readline() y sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline y = int(y) y int(y) int y x = sys.stdin.readline() x sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline x_list = x.split(" ") x_list x.split(" ") x.split x split " " for i in range(y):
  x_list[i] = int(x_list[i]) i range(y) range y x_list[i] = int(x_list[i]) x_list[i] x_list i int(x_list[i]) int x_list[i] x_list i for k in range(0, y):
  print x_list[k], k range(0, y) range 0 y print x_list[k] x_list k print insertionSort(x_list, y) insertionSort x_list y y = sys.stdin.readline() sys.stdin.readline() y x = sys.stdin.readline() sys.stdin.readline() x def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print insertionSort x_list = x.split(" ") x.split(" ") x_list y = int(y) int(y) y
import sys

def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print

y = sys.stdin.readline()
y = int(y)

x = sys.stdin.readline()

x_list = x.split(" ")

for i in range(y):
  x_list[i] = int(x_list[i])

for k in range(0, y):
  print x_list[k],
print

insertionSort(x_list, y)