#include<bits/stdc++.h>
using namespace std;
void Merge(int Left[],int Right[],int arr[],int nL,int nR){
int i=0,j=0,k=0;
while(i<nL && j<nR){
if(Left[i]<=Right[j]){
arr[k++]=Left[i++];
}
else{
arr[k++]=Right[j++];
}
}
while(i<nL){
arr[k++]=Left[i++];
}
while(j<nR){
arr[k++]=Right[j++];
}
}
void MergeSort(int arr[],int n){
if(n<2) return;
int mid=n/2;
int nL=mid;
int nR=(n-mid);
int Left[nL],Right[nR];
for(int i=0;i<nL;i++) Left[i]=arr[i];
for(int i=nL;i<n;i++) Right[i-mid]=arr[i];
MergeSort(Left,nL);
MergeSort(Right,nR);
Merge(Left,Right,arr,nL,nR);
}
int main()
{
int n,arr[100005];
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%d",&arr[i]);
MergeSort(arr,n);
for(int i=0;i<n;i++) printf("%d ",arr[i]);
printf("\n");
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdm9pZCBNZXJnZShpbnQgTGVmdFtdLGludCBSaWdodFtdLGludCBhcnJbXSxpbnQgbkwsaW50IG5SKXsKICAgICAgICBpbnQgaT0wLGo9MCxrPTA7CgogICAgICAgIHdoaWxlKGk8bkwgJiYgajxuUil7CiAgICAgICAgICAgIGlmKExlZnRbaV08PVJpZ2h0W2pdKXsKICAgICAgICAgICAgICAgIGFycltrKytdPUxlZnRbaSsrXTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlewogICAgICAgICAgICAgICAgYXJyW2srK109UmlnaHRbaisrXTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgd2hpbGUoaTxuTCl7CiAgICAgICAgICAgIGFycltrKytdPUxlZnRbaSsrXTsKICAgICAgICB9CgogICAgICAgIHdoaWxlKGo8blIpewogICAgICAgICAgICBhcnJbaysrXT1SaWdodFtqKytdOwogICAgICAgIH0KfQp2b2lkIE1lcmdlU29ydChpbnQgYXJyW10saW50IG4pewogICAgaWYobjwyKSByZXR1cm47CiAgICBpbnQgbWlkPW4vMjsKICAgIGludCBuTD1taWQ7CiAgICBpbnQgblI9KG4tbWlkKTsKICAgIGludCBMZWZ0W25MXSxSaWdodFtuUl07CiAgICBmb3IoaW50IGk9MDtpPG5MO2krKykgTGVmdFtpXT1hcnJbaV07CiAgICBmb3IoaW50IGk9bkw7aTxuO2krKykgUmlnaHRbaS1taWRdPWFycltpXTsKCiAgICBNZXJnZVNvcnQoTGVmdCxuTCk7CiAgICBNZXJnZVNvcnQoUmlnaHQsblIpOwogICAgTWVyZ2UoTGVmdCxSaWdodCxhcnIsbkwsblIpOwoKfQppbnQgbWFpbigpCnsKICAgIGludCBuLGFyclsxMDAwMDVdOwogICAgc2NhbmYoIiVkIiwmbik7CiAgICBmb3IoaW50IGk9MDtpPG47aSsrKSBzY2FuZigiJWQiLCZhcnJbaV0pOwogICAgTWVyZ2VTb3J0KGFycixuKTsKICAgIGZvcihpbnQgaT0wO2k8bjtpKyspIHByaW50ZigiJWQgIixhcnJbaV0pOwogICAgcHJpbnRmKCJcbiIpOwogICAgcmV0dXJuIDA7Cn0K