import sys

def printlist(lst):
	for l in lst:
		print(l),
	print

N = int(sys.stdin.readline().strip())
A = sys.stdin.readline().strip().split(" ")

A = map(lambda x:int(x),A)
for i in range(0,N):
	temp = A[i]
	j = i-1
	while j>=0 and A[j]>temp:
		A[j+1] = A[j]
		j-=1
	A[j+1]=temp
	printlist(A) import sys sys def printlist(lst):
	for l in lst:
		print(l),
	print printlist for l in lst:
		print(l),
	 l lst print(l) print l print lst lst N = int(sys.stdin.readline().strip()) N int(sys.stdin.readline().strip()) int sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip A = sys.stdin.readline().strip().split(" ") A sys.stdin.readline().strip().split(" ") sys.stdin.readline().strip().split sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip split " " A = map(lambda x:int(x),A) A map(lambda x:int(x),A) map lambda x:int(x) int(x) int x x A for i in range(0,N):
	temp = A[i]
	j = i-1
	while j>=0 and A[j]>temp:
		A[j+1] = A[j]
		j-=1
	A[j+1]=temp
	printlist(A) i range(0,N) range 0 N temp = A[i] temp A[i] A i j = i-1 j i-1 i 1 while j>=0 and A[j]>temp:
		A[j+1] = A[j]
		j-=1
	 j>=0 and A[j]>temp j>=0 j 0 A[j]>temp A[j] A j temp A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j-=1 j 1 A[j+1]=temp A[j+1] A j+1 j 1 temp printlist(A) printlist A A = sys.stdin.readline().strip().split(" ") sys.stdin.readline().strip().split(" ") A N = int(sys.stdin.readline().strip()) int(sys.stdin.readline().strip()) N temp = A[i] A[i] temp j = i-1 i-1 j def printlist(lst):
	for l in lst:
		print(l),
	print def printlist(lst):
	for l in lst:
		print(l),
	print printlist A = map(lambda x:int(x),A) map(lambda x:int(x),A) A j-=1 1 j
import sys

def printlist(lst):
	for l in lst:
		print(l),
	print

N = int(sys.stdin.readline().strip())
A = sys.stdin.readline().strip().split(" ")

A = map(lambda x:int(x),A)
for i in range(0,N):
	temp = A[i]
	j = i-1
	while j>=0 and A[j]>temp:
		A[j+1] = A[j]
		j-=1
	A[j+1]=temp
	printlist(A)