#! /usr/bin/python

if __name__ == "__main__":
	n = int(raw_input())
	array = map(int, raw_input().split())
	for i in range(1, n):
		print " ".join(map(str, array))
		key = array[i]
		j = i - 1 
		while j >= 0 and array[j] > key:
			array[j+1] = array[j]
			j -= 1
		array[j+1] = key

	print " ".join(map(str, array)) if __name__ == "__main__":
	n = int(raw_input())
	array = map(int, raw_input().split())
	for i in range(1, n):
		print " ".join(map(str, array))
		key = array[i]
		j = i - 1 
		while j >= 0 and array[j] > key:
			array[j+1] = array[j]
			j -= 1
		array[j+1] = key

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

	 i range(1, n) range 1 n print " ".join(map(str, array)) " ".join " " join map(str, array) map str array key = array[i] key array[i] array i j = i - 1 j i - 1 i 1 while j >= 0 and array[j] > key:
			array[j+1] = array[j]
			j -= 1
		 j >= 0 and array[j] > key j >= 0 j 0 array[j] > key array[j] array j key array[j+1] = array[j] array[j+1] array j+1 j 1 array[j] array j j -= 1 j 1 array[j+1] = key array[j+1] array j+1 j 1 key print " ".join(map(str, array)) " ".join " " join map(str, array) map str array array = map(int, raw_input().split()) map(int, raw_input().split()) array j = i - 1 i - 1 j key = array[i] array[i] key n = int(raw_input()) int(raw_input()) n j -= 1 1 j
#! /usr/bin/python

if __name__ == "__main__":
	n = int(raw_input())
	array = map(int, raw_input().split())
	for i in range(1, n):
		print " ".join(map(str, array))
		key = array[i]
		j = i - 1 
		while j >= 0 and array[j] > key:
			array[j+1] = array[j]
			j -= 1
		array[j+1] = key

	print " ".join(map(str, array))