def trace( nums ):
	output = []
	for num in nums:
		output.append( str( num ) )
		output.append( " " )
	output.pop( )
	print( "".join( output )  )

n = int( raw_input( ) )
nums = [ int( val ) for val in raw_input( ).split( " " ) ]
trace( nums )

for i in range( 1, len( nums ) ):
	key = nums[i]
	j = i - 1
	while 0 <= j and key < nums[j]:
		nums[ j+1 ] = nums[j]
		j -= 1
	nums[ j+1 ] = key
	trace( nums ) def trace( nums ):
	output = []
	for num in nums:
		output.append( str( num ) )
		output.append( " " )
	output.pop( )
	print( "".join( output )  ) trace output = [] output [] for num in nums:
		output.append( str( num ) )
		output.append( " " )
	 num nums output.append( str( num ) ) output.append output append str( num ) str num output.append( " " ) output.append output append " " output.pop( ) output.pop output pop print( "".join( output )  ) print "".join( output ) "".join "" join output nums nums n = int( raw_input( ) ) n int( raw_input( ) ) int raw_input( ) raw_input int( val ) for val in raw_input( ).split( " " ) for val in raw_input( ).split( " " ) val raw_input( ).split( " " ) ( ).split ( ) raw_input split " " for val in raw_input( ).split( " " ) int( val ) int val nums = [ int( val ) for val in raw_input( ).split( " " ) ] nums [ int( val ) for val in raw_input( ).split( " " ) ] trace( nums ) trace nums for i in range( 1, len( nums ) ):
	key = nums[i]
	j = i - 1
	while 0 <= j and key < nums[j]:
		nums[ j+1 ] = nums[j]
		j -= 1
	nums[ j+1 ] = key
	trace( nums ) i range( 1, len( nums ) ) range 1 len( nums ) len nums key = nums[i] key nums[i] nums i j = i - 1 j i - 1 i 1 while 0 <= j and key < nums[j]:
		nums[ j+1 ] = nums[j]
		j -= 1
	 0 <= j and key < nums[j] 0 <= j 0 j key < nums[j] key nums[j] nums j nums[ j+1 ] = nums[j] nums[ j+1 ] nums j+1 j 1 nums[j] nums j j -= 1 j 1 nums[ j+1 ] = key nums[ j+1 ] nums j+1 j 1 key trace( nums ) trace nums nums = [ int( val ) for val in raw_input( ).split( " " ) ] [ int( val ) for val in raw_input( ).split( " " ) ] nums key = nums[i] nums[i] key def trace( nums ):
	output = []
	for num in nums:
		output.append( str( num ) )
		output.append( " " )
	output.pop( )
	print( "".join( output )  ) def trace( nums ):
	output = []
	for num in nums:
		output.append( str( num ) )
		output.append( " " )
	output.pop( )
	print( "".join( output )  ) trace j -= 1 1 j j = i - 1 i - 1 j n = int( raw_input( ) ) int( raw_input( ) ) n
def trace( nums ):
	output = []
	for num in nums:
		output.append( str( num ) )
		output.append( " " )
	output.pop( )
	print( "".join( output )  )

n = int( raw_input( ) )
nums = [ int( val ) for val in raw_input( ).split( " " ) ]
trace( nums )

for i in range( 1, len( nums ) ):
	key = nums[i]
	j = i - 1
	while 0 <= j and key < nums[j]:
		nums[ j+1 ] = nums[j]
		j -= 1
	nums[ j+1 ] = key
	trace( nums )