def insertionSort(At, Nt):
	for i in range(Nt):
		v = At[i]
		j = i - 1
		while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		A[j + 1] = v
		print(" ".join(map(str,At)))
	return At

if __name__ == '__main__':
	N = int(input())
	A = list(map(int, input().split()))
	A = insertionSort(A, N)
	#print(" ".join(map(str,A))) def insertionSort(At, Nt):
	for i in range(Nt):
		v = At[i]
		j = i - 1
		while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		A[j + 1] = v
		print(" ".join(map(str,At)))
	return At insertionSort for i in range(Nt):
		v = At[i]
		j = i - 1
		while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		A[j + 1] = v
		print(" ".join(map(str,At)))
	 i range(Nt) range Nt v = At[i] v At[i] At i j = i - 1 j i - 1 i 1 while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		 j >= 0 and At[j] > v j >= 0 j 0 At[j] > v At[j] At j v A[j + 1] = A[j] A[j + 1] A j + 1 j 1 A[j] A j j = j - 1 j j - 1 j 1 A[j + 1] = v A[j + 1] A j + 1 j 1 v print(" ".join(map(str,At))) print " ".join(map(str,At)) " ".join " " join map(str,At) map str At return At At At At Nt Nt if __name__ == '__main__':
	N = int(input())
	A = list(map(int, input().split()))
	A = insertionSort(A, N)
	#print(" ".join(map(str,A))) __name__ == '__main__' __name__ '__main__' N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A = insertionSort(A, N) A insertionSort(A, N) insertionSort A N def insertionSort(At, Nt):
	for i in range(Nt):
		v = At[i]
		j = i - 1
		while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		A[j + 1] = v
		print(" ".join(map(str,At)))
	return At def insertionSort(At, Nt):
	for i in range(Nt):
		v = At[i]
		j = i - 1
		while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		A[j + 1] = v
		print(" ".join(map(str,At)))
	return At insertionSort A = insertionSort(A, N) insertionSort(A, N) A N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A
def insertionSort(At, Nt):
	for i in range(Nt):
		v = At[i]
		j = i - 1
		while j >= 0 and At[j] > v:
			A[j + 1] = A[j]
			j = j - 1
		A[j + 1] = v
		print(" ".join(map(str,At)))
	return At

if __name__ == '__main__':
	N = int(input())
	A = list(map(int, input().split()))
	A = insertionSort(A, N)
	#print(" ".join(map(str,A)))