n = int(input())
lst = list(map(int, input().split()))
for i in range(n):
	key = lst[i]
	j = i-1
	while j>=0 and lst[j]>key:
		lst[j+1] = lst[j]
		j -= 1
	lst[j+1] = key
	print(" ".join(map(str,lst))) n = int(input()) n int(input()) int input() input lst = list(map(int, input().split())) lst list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(n):
	key = lst[i]
	j = i-1
	while j>=0 and lst[j]>key:
		lst[j+1] = lst[j]
		j -= 1
	lst[j+1] = key
	print(" ".join(map(str,lst))) i range(n) range n key = lst[i] key lst[i] lst i j = i-1 j i-1 i 1 while j>=0 and lst[j]>key:
		lst[j+1] = lst[j]
		j -= 1
	 j>=0 and lst[j]>key j>=0 j 0 lst[j]>key lst[j] lst j key lst[j+1] = lst[j] lst[j+1] lst j+1 j 1 lst[j] lst j j -= 1 j 1 lst[j+1] = key lst[j+1] lst j+1 j 1 key print(" ".join(map(str,lst))) print " ".join(map(str,lst)) " ".join " " join map(str,lst) map str lst lst = list(map(int, input().split())) list(map(int, input().split())) lst key = lst[i] lst[i] key n = int(input()) int(input()) n j = i-1 i-1 j j -= 1 1 j
n = int(input())
lst = list(map(int, input().split()))
for i in range(n):
	key = lst[i]
	j = i-1
	while j>=0 and lst[j]>key:
		lst[j+1] = lst[j]
		j -= 1
	lst[j+1] = key
	print(" ".join(map(str,lst)))