#input number
n = raw_input()

if n < 1 and n > 100:
	exit()

# input elements
l = raw_input()

elements = [int(e) for e in l.split()]

print ' '.join(str(e) for e in elements)

for i in range(1, int(n)):
	key = elements[i]
	j = i - 1
	while j >= 0 and elements[j] > key:
		elements[j + 1] = elements[j]
		j -= 1
	elements[j + 1] = key
	# output
	print ' '.join(str(e) for e in elements) n = raw_input() n raw_input() raw_input if n < 1 and n > 100:
	exit()

# input elements n < 1 and n > 100 n < 1 n 1 n > 100 n 100 exit() exit l = raw_input() l raw_input() raw_input int(e) for e in l.split() for e in l.split() e l.split() l.split l split for e in l.split() int(e) int e elements = [int(e) for e in l.split()] elements [int(e) for e in l.split()] print ' '.join(str(e) for e in elements) ' '.join ' ' join str(e) str e for i in range(1, int(n)):
	key = elements[i]
	j = i - 1
	while j >= 0 and elements[j] > key:
		elements[j + 1] = elements[j]
		j -= 1
	elements[j + 1] = key
	# output
	print ' '.join(str(e) for e in elements) i range(1, int(n)) range 1 int(n) int n key = elements[i] key elements[i] elements i j = i - 1 j i - 1 i 1 while j >= 0 and elements[j] > key:
		elements[j + 1] = elements[j]
		j -= 1
	 j >= 0 and elements[j] > key j >= 0 j 0 elements[j] > key elements[j] elements j key elements[j + 1] = elements[j] elements[j + 1] elements j + 1 j 1 elements[j] elements j j -= 1 j 1 elements[j + 1] = key elements[j + 1] elements j + 1 j 1 key print ' '.join(str(e) for e in elements) ' '.join ' ' join str(e) str e n = raw_input() raw_input() n j -= 1 1 j l = raw_input() raw_input() l key = elements[i] elements[i] key elements = [int(e) for e in l.split()] [int(e) for e in l.split()] elements j = i - 1 i - 1 j
#input number
n = raw_input()

if n < 1 and n > 100:
	exit()

# input elements
l = raw_input()

elements = [int(e) for e in l.split()]

print ' '.join(str(e) for e in elements)

for i in range(1, int(n)):
	key = elements[i]
	j = i - 1
	while j >= 0 and elements[j] > key:
		elements[j + 1] = elements[j]
		j -= 1
	elements[j + 1] = key
	# output
	print ' '.join(str(e) for e in elements)