def insertionSort(data):
	for old in range(len(data)):
		new = old
		while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		i = data.pop(old)
		data.insert(new,i)
		yield data

input()
data = [int(s) for s in input().split()]
[print(' '.join([str(i) for i in d])) for d in insertionSort(data)] def insertionSort(data):
	for old in range(len(data)):
		new = old
		while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		i = data.pop(old)
		data.insert(new,i)
		yield data insertionSort for old in range(len(data)):
		new = old
		while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		i = data.pop(old)
		data.insert(new,i)
		yield data old range(len(data)) range len(data) len data new = old new old while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		 new>0 and data[old]<data[max(0,new-1)] new>0 new 0 data[old]<data[max(0,new-1)] data[old] data old data[max(0,new-1)] data max(0,new-1) max 0 new-1 new 1 new -= 1 new 1 i = data.pop(old) i data.pop(old) data.pop data pop old data.insert(new,i) data.insert data insert new i yield data data data data input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s data = [int(s) for s in input().split()] data [int(s) for s in input().split()] print(' '.join([str(i) for i in d])) for d in insertionSort(data) for d in insertionSort(data) d insertionSort(data) insertionSort data for d in insertionSort(data) print(' '.join([str(i) for i in d])) print ' '.join([str(i) for i in d]) ' '.join ' ' join [str(i) for i in d] [print(' '.join([str(i) for i in d])) for d in insertionSort(data)] data = [int(s) for s in input().split()] [int(s) for s in input().split()] data def insertionSort(data):
	for old in range(len(data)):
		new = old
		while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		i = data.pop(old)
		data.insert(new,i)
		yield data def insertionSort(data):
	for old in range(len(data)):
		new = old
		while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		i = data.pop(old)
		data.insert(new,i)
		yield data insertionSort
def insertionSort(data):
	for old in range(len(data)):
		new = old
		while new>0 and data[old]<data[max(0,new-1)]:
			new -= 1
		i = data.pop(old)
		data.insert(new,i)
		yield data

input()
data = [int(s) for s in input().split()]
[print(' '.join([str(i) for i in d])) for d in insertionSort(data)]