a = []
def outputList(a):
	for i in range(len(a)):
		if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n')

n = int(input().strip())
for i in input().split():
	a.append(int(i))
	if len(a)==n:
		break
for i in range(1,len(a)):
	outputList(a)
	key = a[i]
	j = i - 1
	while j >= 0 and a[j] > key:
		a[j+1] = a[j]
		j -= 1
	a[j+1] = key
outputList(a) a = [] a [] def outputList(a):
	for i in range(len(a)):
		if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n') outputList for i in range(len(a)):
		if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n') i range(len(a)) range len(a) len a if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n') i != len(a)-1 i len(a)-1 len(a) len a 1 print("%d"%a[i],end=' ') print "%d"%a[i] "%d" a[i] a i end=' ' end ' ' print("%d"%a[i],end='\n') print "%d"%a[i] "%d" a[i] a i end='\n' end '\n' a a n = int(input().strip()) n int(input().strip()) int input().strip() ().strip () input strip for i in input().split():
	a.append(int(i))
	if len(a)==n:
		break i input().split() ().split () input split a.append(int(i)) a.append a append int(i) int i if len(a)==n:
		break len(a)==n len(a) len a n break for i in range(1,len(a)):
	outputList(a)
	key = a[i]
	j = i - 1
	while j >= 0 and a[j] > key:
		a[j+1] = a[j]
		j -= 1
	a[j+1] = key i range(1,len(a)) range 1 len(a) len a outputList(a) outputList a key = a[i] key a[i] a i j = i - 1 j i - 1 i 1 while j >= 0 and a[j] > key:
		a[j+1] = a[j]
		j -= 1
	 j >= 0 and a[j] > key j >= 0 j 0 a[j] > key a[j] a j key a[j+1] = a[j] a[j+1] a j+1 j 1 a[j] a j j -= 1 j 1 a[j+1] = key a[j+1] a j+1 j 1 key outputList(a) outputList a a = [] [] a j = i - 1 i - 1 j j -= 1 1 j key = a[i] a[i] key def outputList(a):
	for i in range(len(a)):
		if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n') def outputList(a):
	for i in range(len(a)):
		if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n') outputList n = int(input().strip()) int(input().strip()) n
a = []
def outputList(a):
	for i in range(len(a)):
		if i != len(a)-1:
			print("%d"%a[i],end=' ')
		else:
			print("%d"%a[i],end='\n')

n = int(input().strip())
for i in input().split():
	a.append(int(i))
	if len(a)==n:
		break
for i in range(1,len(a)):
	outputList(a)
	key = a[i]
	j = i - 1
	while j >= 0 and a[j] > key:
		a[j+1] = a[j]
		j -= 1
	a[j+1] = key
outputList(a)