#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IHBhcnRpdGlvbihpbnQgYVtdLGludCBsb3csaW50IGhpZ2gpOwoKdm9pZCBxdWlja3NvcnQoaW50IGFbXSwgaW50IGxvdyAsaW50IGhpZ2gpewoJaWYobG93IDwgaGlnaCl7CgkJaW50IHBpdm90PXBhcnRpdGlvbihhLGxvdyxoaWdoKTsKCQlxdWlja3NvcnQoYSxsb3cscGl2b3QtMSk7CgkJcXVpY2tzb3J0KGEscGl2b3QrMSxoaWdoKTsKCX0KfQppbnQgcGFydGl0aW9uKGludCBhW10saW50IGxvdyxpbnQgaGlnaCl7CglpbnQgcGl2PWFbaGlnaF07CglpbnQgaT1sb3ctMTsKCWZvcihpbnQgaj1sb3c7ajxoaWdoO2orKyl7CgkJaWYoYVtqXTw9cGl2KXsKCQkJaSsrOwoJCQlzd2FwKGFbaV0sYVtqXSk7CgkJfQoJfQoJc3dhcChhW2krMV0sYVtoaWdoXSk7CglyZXR1cm4gaSsxOwp9CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWludCBuOwoJY2luPj5uOwoJaW50IGFbbl07Cglmb3IoaW50IGk9MDtpPG47aSsrKXsKCQljaW4+PmFbaV07Cgl9CglxdWlja3NvcnQoYSwwLG4tMSk7Cglmb3IoaW50IGk9MDtpPG47aSsrKXsKCQljb3V0PDxhW2ldPDwiICI7Cgl9CglyZXR1cm4gMDsKfQ==