#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A

num = int(input())

A = list(map(int, input().split()))
print(" ".join(list(map(str,A))))

for i in list(range(1, len(A))):
	v = A[i]
	j = i - 1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
	print(" ".join(list(map(str,A)))) num = int(input()) num 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 print(" ".join(list(map(str,A)))) print " ".join(list(map(str,A))) " ".join " " join list(map(str,A)) list map(str,A) map str A for i in list(range(1, len(A))):
	v = A[i]
	j = i - 1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
	print(" ".join(list(map(str,A)))) i list(range(1, len(A))) list range(1, len(A)) range 1 len(A) len A 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 print(" ".join(list(map(str,A)))) print " ".join(list(map(str,A))) " ".join " " join list(map(str,A)) list map(str,A) map str A A = list(map(int, input().split())) list(map(int, input().split())) A j -= 1 1 j v = A[i] A[i] v num = int(input()) int(input()) num j = i - 1 i - 1 j
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A

num = int(input())

A = list(map(int, input().split()))
print(" ".join(list(map(str,A))))

for i in list(range(1, len(A))):
	v = A[i]
	j = i - 1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
	print(" ".join(list(map(str,A))))