input()
xs = list(map(int, input().split()))

def insertion_sort(xs):
  for i in range(1, len(xs)):
    v = xs[i]
    j = i - 1
    while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
    xs[j + 1] = v
    print(*xs)

print(*xs)
insertion_sort(xs) input() input xs = list(map(int, input().split())) xs list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def insertion_sort(xs):
  for i in range(1, len(xs)):
    v = xs[i]
    j = i - 1
    while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
    xs[j + 1] = v
    print(*xs) insertion_sort for i in range(1, len(xs)):
    v = xs[i]
    j = i - 1
    while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
    xs[j + 1] = v
    print(*xs) i range(1, len(xs)) range 1 len(xs) len xs v = xs[i] v xs[i] xs i j = i - 1 j i - 1 i 1 while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
     j >= 0 and xs[j] > v j >= 0 j 0 xs[j] > v xs[j] xs j v xs[j + 1] = xs[j] xs[j + 1] xs j + 1 j 1 xs[j] xs j j -= 1 j 1 xs[j + 1] = v xs[j + 1] xs j + 1 j 1 v print(*xs) print *xs xs xs xs print(*xs) print *xs xs insertion_sort(xs) insertion_sort xs xs = list(map(int, input().split())) list(map(int, input().split())) xs def insertion_sort(xs):
  for i in range(1, len(xs)):
    v = xs[i]
    j = i - 1
    while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
    xs[j + 1] = v
    print(*xs) def insertion_sort(xs):
  for i in range(1, len(xs)):
    v = xs[i]
    j = i - 1
    while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
    xs[j + 1] = v
    print(*xs) insertion_sort
input()
xs = list(map(int, input().split()))

def insertion_sort(xs):
  for i in range(1, len(xs)):
    v = xs[i]
    j = i - 1
    while j >= 0 and xs[j] > v:
      xs[j + 1] = xs[j]
      j -= 1
    xs[j + 1] = v
    print(*xs)

print(*xs)
insertion_sort(xs)