N = int(raw_input())
A = map(int, raw_input().split())
print " ".join(map(str, A))
for i in xrange(1, len(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(map(str, A)) N = int(raw_input()) N int(raw_input()) int raw_input() raw_input A = map(int, raw_input().split()) A map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split print " ".join(map(str, A)) " ".join " " join map(str, A) map str A for i in xrange(1, len(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(map(str, A)) i xrange(1, len(A)) xrange 1 len(A) len 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 print " ".join(map(str, A)) " ".join " " join map(str, A) map str A key = A[i] A[i] key N = int(raw_input()) int(raw_input()) N j = i-1 i-1 j A = map(int, raw_input().split()) map(int, raw_input().split()) A j -= 1 1 j
N = int(raw_input())
A = map(int, raw_input().split())
print " ".join(map(str, A))
for i in xrange(1, len(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(map(str, A))