def ins(A,N):
	for i in range(N):
		v=A[i]
		j=i-1
		while j>=0 and A[j]>v:
			A[j+1]=A[j]
			j-=1
		A[j+1]=v
		for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ")
N=int(input())
A=list(map(int,input().split(" ")))
ins(A,N) def ins(A,N):
	for i in range(N):
		v=A[i]
		j=i-1
		while j>=0 and A[j]>v:
			A[j+1]=A[j]
			j-=1
		A[j+1]=v
		for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ") ins for i in range(N):
		v=A[i]
		j=i-1
		while j>=0 and A[j]>v:
			A[j+1]=A[j]
			j-=1
		A[j+1]=v
		for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ") i range(N) range N v=A[i] v A[i] A i j=i-1 j i-1 i 1 while j>=0 and A[j]>v:
			A[j+1]=A[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-=1 j 1 A[j+1]=v A[j+1] A j+1 j 1 v for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ") k range(len(A)) range len(A) len A if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ") k==len(A)-1 k len(A)-1 len(A) len A 1 print(A[k]) print A[k] A k print(A[k],end=" ") print A[k] A k end=" " end " " A A N N 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 " " ins(A,N) ins A N N=int(input()) int(input()) N A=list(map(int,input().split(" "))) list(map(int,input().split(" "))) A def ins(A,N):
	for i in range(N):
		v=A[i]
		j=i-1
		while j>=0 and A[j]>v:
			A[j+1]=A[j]
			j-=1
		A[j+1]=v
		for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ") def ins(A,N):
	for i in range(N):
		v=A[i]
		j=i-1
		while j>=0 and A[j]>v:
			A[j+1]=A[j]
			j-=1
		A[j+1]=v
		for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ") ins
def ins(A,N):
	for i in range(N):
		v=A[i]
		j=i-1
		while j>=0 and A[j]>v:
			A[j+1]=A[j]
			j-=1
		A[j+1]=v
		for k in range(len(A)):
			if k==len(A)-1:
				print(A[k])
			else:
				print(A[k],end=" ")
N=int(input())
A=list(map(int,input().split(" ")))
ins(A,N)