import sys

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

N = int(raw_input())
A = map(int, raw_input().split())
a_str = map(str, A)
print(" ".join(a_str))
for i in range(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
	a_str = map(str, A)
	print(" ".join(a_str))