#include <stdio.h>
#define MAX 100000

int partition( int *A, int p, int r );

int Quicksort( int *A, int p, int r );

int main(void)
{
    int Arr[MAX] = {};
    int i = 0;
    int flag = 0;
    int order = 0;
     
    scanf("%d\n", &order);
     
    for ( i = 0; i < order; i++ ) {
        scanf("%d ", &Arr[i]);
    }
     
    Quicksort(Arr, 0, order-1);
    for ( i = 0; i < order - 1 ; i++ ) {
        printf("%d ", Arr[i]);
    }
    printf("%d\n", Arr[i]);
    return 0;
}
 
int partition( int *A, int p, int r ) 
{
    int x = 0;
    int i = 0;
    int j = 0;
    int tmp = 0;
     
    x = A[r];
    i = p - 1;
    for ( j = p; j < r; j++ ) {
        if ( A[j] <= x ) {
            i = i+1;
            tmp = A[i];
            A[i] = A[j];
            A[j] = tmp;
        }
    }
     
    tmp = A[r];
    A[r] = A[i+1];
    A[i+1] = tmp;
    return i+1;
}

int Quicksort( int *A, int p, int r )
{
	int q = 0;
	if ( p < r ) {
		q = partition( A, p, r );
		Quicksort(A, p, q-1);
		Quicksort(A, p+1, r);
	}
	return 0;
}
