//归并排序
#include<bits/stdc++.h>
using namespace std;
const int N = 10010;
int a[N],b[N];
//归并排序
void merge(int l,int r) {
if(l>=r) return ;
int mid=l+r>>1;
merge(l,mid);
merge(mid+1,r);
int ll=l,rr=mid+1,id=l;
while(ll<=mid && rr<=r) {
if(a[ll]>a[rr]) {
b[id]=a[rr];
rr++;
id++;
}
else {
b[id]=a[ll];
ll++;
id++;
}
}
while(ll<=mid) {
b[id]=a[ll];
ll++;
id++;
}
while(rr<=r) {
b[id]=a[rr];
rr++;
id++;
}
for(int i=l;i<=r;i++) a[i]=b[i];
}
int main() {
int n;cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
merge(1,n);
for(int i=1;i<=n;i++) cout<<a[i]<<" ";
}