n = int(raw_input())
a = map(int, raw_input().split())

def print_list(list):
	for i in range(len(list)-1):
		print(list[i]),
	print(list[len(list)-1])

#print("")
print_list(a)
for i in range(1,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
	print_list(a) 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 def print_list(list):
	for i in range(len(list)-1):
		print(list[i]),
	print(list[len(list)-1])

#print("") print_list for i in range(len(list)-1):
		print(list[i]),
	 i range(len(list)-1) range len(list)-1 len(list) len list 1 print(list[i]) print list[i] list i print(list[len(list)-1]) print list[len(list)-1] list len(list)-1 len(list) len list 1 list list print_list(a) print_list a for i in range(1,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
	print_list(a) i range(1,n) range 1 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 print_list(a) print_list a j -= 1 1 j v = a[i] a[i] v def print_list(list):
	for i in range(len(list)-1):
		print(list[i]),
	print(list[len(list)-1])

#print("") def print_list(list):
	for i in range(len(list)-1):
		print(list[i]),
	print(list[len(list)-1])

#print("") print_list n = int(raw_input()) int(raw_input()) n j = i - 1 i - 1 j a = map(int, raw_input().split()) map(int, raw_input().split()) a
n = int(raw_input())
a = map(int, raw_input().split())

def print_list(list):
	for i in range(len(list)-1):
		print(list[i]),
	print(list[len(list)-1])

#print("")
print_list(a)
for i in range(1,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
	print_list(a)