N=input()
A=map(int,raw_input().split())
for i in range(N-1):
	for k in range(N-1):
		print A[k],
	print A[N-1]
	v=A[i+1]
	j=i
	while j>=0 and A[j] >v:
		A[j+1]=A[j]
		j=j-1
	A[j+1]=v

for m in range(N-1):
	print str(A[m]),
print A[N-1] N=input() N input() input A=map(int,raw_input().split()) A map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split for i in range(N-1):
	for k in range(N-1):
		print A[k],
	print A[N-1]
	v=A[i+1]
	j=i
	while j>=0 and A[j] >v:
		A[j+1]=A[j]
		j=j-1
	A[j+1]=v i range(N-1) range N-1 N 1 for k in range(N-1):
		print A[k],
	 k range(N-1) range N-1 N 1 print A[k] A k print A[N-1] A N-1 N 1 v=A[i+1] v A[i+1] A i+1 i 1 j=i j i while j>=0 and A[j] >v:
		A[j+1]=A[j]
		j=j-1
	 j>=0 and A[j] >v j>=0 j 0 A[j] >v A[j] A 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 for m in range(N-1):
	print str(A[m]), m range(N-1) range N-1 N 1 print str(A[m]) str A[m] A m print A[N-1] A N-1 N 1 N=input() input() N j=j-1 j-1 j A=map(int,raw_input().split()) map(int,raw_input().split()) A j=i i j v=A[i+1] A[i+1] v
N=input()
A=map(int,raw_input().split())
for i in range(N-1):
	for k in range(N-1):
		print A[k],
	print A[N-1]
	v=A[i+1]
	j=i
	while j>=0 and A[j] >v:
		A[j+1]=A[j]
		j=j-1
	A[j+1]=v

for m in range(N-1):
	print str(A[m]),
print A[N-1]