def listprint(lists):
	global N
	count = 0
	for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i)

if __name__ == '__main__':
	N = int(input())
	l = input().split()

	for i in range(N):
		l[i] = int(l[i])

	listprint(l)

	for i in range(1, N):
		v = l[i]
		j = i - 1

		while j >= 0 and l[j] > v:
			l[j + 1] = l[j]
			j -= 1

		l[j + 1] = v
		listprint(l) def listprint(lists):
	global N
	count = 0
	for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i) listprint global N count = 0 count 0 for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i) i lists count += 1 count 1 if count < N:
			print(i, end = ' ')
		 count < N count N print(i, end = ' ') print i end = ' ' end ' ' if count == N:
			print(i) count == N count N print(i) print i lists lists if __name__ == '__main__':
	N = int(input())
	l = input().split()

	for i in range(N):
		l[i] = int(l[i])

	listprint(l)

	for i in range(1, N):
		v = l[i]
		j = i - 1

		while j >= 0 and l[j] > v:
			l[j + 1] = l[j]
			j -= 1

		l[j + 1] = v
		listprint(l) __name__ == '__main__' __name__ '__main__' N = int(input()) N int(input()) int input() input l = input().split() l input().split() ().split () input split for i in range(N):
		l[i] = int(l[i])

	 i range(N) range N l[i] = int(l[i]) l[i] l i int(l[i]) int l[i] l i listprint(l) listprint l for i in range(1, N):
		v = l[i]
		j = i - 1

		while j >= 0 and l[j] > v:
			l[j + 1] = l[j]
			j -= 1

		l[j + 1] = v
		listprint(l) i range(1, N) range 1 N v = l[i] v l[i] l i j = i - 1 j i - 1 i 1 while j >= 0 and l[j] > v:
			l[j + 1] = l[j]
			j -= 1

		 j >= 0 and l[j] > v j >= 0 j 0 l[j] > v l[j] l j v l[j + 1] = l[j] l[j + 1] l j + 1 j 1 l[j] l j j -= 1 j 1 l[j + 1] = v l[j + 1] l j + 1 j 1 v listprint(l) listprint l v = l[i] l[i] v j = i - 1 i - 1 j j -= 1 1 j def listprint(lists):
	global N
	count = 0
	for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i) def listprint(lists):
	global N
	count = 0
	for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i) listprint l = input().split() input().split() l N = int(input()) int(input()) N
def listprint(lists):
	global N
	count = 0
	for i in lists:
		count += 1
		if count < N:
			print(i, end = ' ')
		if count == N:
			print(i)

if __name__ == '__main__':
	N = int(input())
	l = input().split()

	for i in range(N):
		l[i] = int(l[i])

	listprint(l)

	for i in range(1, N):
		v = l[i]
		j = i - 1

		while j >= 0 and l[j] > v:
			l[j + 1] = l[j]
			j -= 1

		l[j + 1] = v
		listprint(l)
