n = int(input())

data = input().split()

array = []

for i in data:
  array.append(int(i))

for i in range(1, n):
  print(*array)

  key = array[i]

  j = i - 1

  while j >= 0 and array[j] > key:
    array[j+1] = array[j]
    j -= 1

  array[j+1] = key 

print(*array)

   n = int(input()) n int(input()) int input() input data = input().split() data input().split() ().split () input split array = [] array [] for i in data:
  array.append(int(i)) i data array.append(int(i)) array.append array append int(i) int i for i in range(1, n):
  print(*array)

  key = array[i]

  j = i - 1

  while j >= 0 and array[j] > key:
    array[j+1] = array[j]
    j -= 1

  array[j+1] = key  i range(1, n) range 1 n print(*array) print *array array key = array[i] key array[i] array i j = i - 1 j i - 1 i 1 while j >= 0 and array[j] > key:
    array[j+1] = array[j]
    j -= 1

   j >= 0 and array[j] > key j >= 0 j 0 array[j] > key array[j] array j key array[j+1] = array[j] array[j+1] array j+1 j 1 array[j] array j j -= 1 j 1 array[j+1] = key array[j+1] array j+1 j 1 key print(*array) print *array array j = i - 1 i - 1 j key = array[i] array[i] key n = int(input()) int(input()) n data = input().split() input().split() data j -= 1 1 j array = [] [] array
n = int(input())

data = input().split()

array = []

for i in data:
  array.append(int(i))

for i in range(1, n):
  print(*array)

  key = array[i]

  j = i - 1

  while j >= 0 and array[j] > key:
    array[j+1] = array[j]
    j -= 1

  array[j+1] = key 

print(*array)

  
