N = int( input() ) A = list( map( int, input().split() ) ) for i in range( 1, 2 * N - 3, 1 ): for j in range( i + 1 ): if N <= j: continue if not ( 0 <= i - j and i - j < N ): continue if not ( j < i - j ): continue if A[ j ] > A[ i - j ]: A[ j ], A[ i - j ] = A[ i - j ], A[ j ] print( *A )