_ = input()
A = [int(a) for a in input().split(" ")]
for i in range(1, len(A)):
  print(" ".join([str(a) for a in A]))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j + 1] = key
print(" ".join([str(a) for a in A])) _ = input() _ input() input int(a) for a in input().split(" ") for a in input().split(" ") a input().split(" ") ().split () input split " " for a in input().split(" ") int(a) int a A = [int(a) for a in input().split(" ")] A [int(a) for a in input().split(" ")] for i in range(1, len(A)):
  print(" ".join([str(a) for a in A]))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j + 1] = key i range(1, len(A)) range 1 len(A) len A str(a) for a in A for a in A a A for a in A str(a) str a print(" ".join([str(a) for a in A])) print " ".join([str(a) for a in A]) " ".join " " join [str(a) for a in A] key = A[i] key A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
   j >= 0 and A[j] > key j >= 0 j 0 A[j] > key A[j] A j key A[j + 1] = A[j] A[j + 1] A j + 1 j 1 A[j] A j j -= 1 j 1 A[j + 1] = key A[j + 1] A j + 1 j 1 key str(a) for a in A for a in A a A for a in A str(a) str a print(" ".join([str(a) for a in A])) print " ".join([str(a) for a in A]) " ".join " " join [str(a) for a in A] j = i - 1 i - 1 j key = A[i] A[i] key A = [int(a) for a in input().split(" ")] [int(a) for a in input().split(" ")] A _ = input() input() _ j -= 1 1 j
_ = input()
A = [int(a) for a in input().split(" ")]
for i in range(1, len(A)):
  print(" ".join([str(a) for a in A]))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j + 1] = key
print(" ".join([str(a) for a in A]))