def Print(numlist):
	for t in range(len(numlist)):
		print(numlist[t], end = '')
		if t != len(numlist) - 1:
			print(end = ' ')
	print()

n = eval(input())
numlist = [eval(item) for item in input().split()]
Print(numlist)
for i in range(1, n):
	tmp = numlist[i]
	for j in range(i, -1, -1):
		if tmp > numlist[j - 1]:
			break
		numlist[j] = numlist[j - 1]
	numlist[j] = tmp
	Print(numlist) def Print(numlist):
	for t in range(len(numlist)):
		print(numlist[t], end = '')
		if t != len(numlist) - 1:
			print(end = ' ')
	print() Print for t in range(len(numlist)):
		print(numlist[t], end = '')
		if t != len(numlist) - 1:
			print(end = ' ')
	 t range(len(numlist)) range len(numlist) len numlist print(numlist[t], end = '') print numlist[t] numlist t end = '' end '' if t != len(numlist) - 1:
			print(end = ' ')
	 t != len(numlist) - 1 t len(numlist) - 1 len(numlist) len numlist 1 print(end = ' ') print end = ' ' end ' ' print() print numlist numlist n = eval(input()) n eval(input()) eval input() input eval(item) for item in input().split() for item in input().split() item input().split() ().split () input split for item in input().split() eval(item) eval item numlist = [eval(item) for item in input().split()] numlist [eval(item) for item in input().split()] Print(numlist) Print numlist for i in range(1, n):
	tmp = numlist[i]
	for j in range(i, -1, -1):
		if tmp > numlist[j - 1]:
			break
		numlist[j] = numlist[j - 1]
	numlist[j] = tmp
	Print(numlist) i range(1, n) range 1 n tmp = numlist[i] tmp numlist[i] numlist i for j in range(i, -1, -1):
		if tmp > numlist[j - 1]:
			break
		numlist[j] = numlist[j - 1]
	 j range(i, -1, -1) range i -1 -1 if tmp > numlist[j - 1]:
			break
		 tmp > numlist[j - 1] tmp numlist[j - 1] numlist j - 1 j 1 break numlist[j] = numlist[j - 1] numlist[j] numlist j numlist[j - 1] numlist j - 1 j 1 numlist[j] = tmp numlist[j] numlist j tmp Print(numlist) Print numlist n = eval(input()) eval(input()) n tmp = numlist[i] numlist[i] tmp numlist = [eval(item) for item in input().split()] [eval(item) for item in input().split()] numlist def Print(numlist):
	for t in range(len(numlist)):
		print(numlist[t], end = '')
		if t != len(numlist) - 1:
			print(end = ' ')
	print() def Print(numlist):
	for t in range(len(numlist)):
		print(numlist[t], end = '')
		if t != len(numlist) - 1:
			print(end = ' ')
	print() Print
def Print(numlist):
	for t in range(len(numlist)):
		print(numlist[t], end = '')
		if t != len(numlist) - 1:
			print(end = ' ')
	print()

n = eval(input())
numlist = [eval(item) for item in input().split()]
Print(numlist)
for i in range(1, n):
	tmp = numlist[i]
	for j in range(i, -1, -1):
		if tmp > numlist[j - 1]:
			break
		numlist[j] = numlist[j - 1]
	numlist[j] = tmp
	Print(numlist)