#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int partition(int a[],int low,int high);

void quicksort(int a[], int low ,int high){
	if(low < high){
		int pivot=partition(a,low,high);
		quicksort(a,low,pivot-1);
		quicksort(a,pivot+1,high);
	}
}
int partition(int a[],int low,int high){
	int piv=a[high];
	int i=low-1;
	for(int j=low;j<high;j++){
		if(a[j]<=piv){
			i++;
			swap(a[i],a[j]);
		}
	}
	swap(a[i+1],a[high]);
	return i+1;
}

int main() {
	// your code goes here
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	quicksort(a,0,n-1);
	for(int i=0;i<n;i++){
		cout<<a[i]<<" ";
	}
	return 0;
}