include...
using namespace std;
const int N=1e6+10;
int c[N],tmp[N];
void merge(int c[],int l,int r);//归并(稳定)
void quick(int c[],int l,int r)//快排(不稳定)
{
if(l>=r)return;
int x=c[(l+r)>>1],i=l-1,j=r+1;
while(i<j) {
do i++; while (c[i] < x);
do j--; while (c[j] > x);
if (i<j)swap(c[i], c[j]);
}
quick(c,l,j);
quick(c,j+1,r);
}
void merge(int c[],int l,int r)
{
if(l>=r)return;
int mid=l+r>>1;
merge(c,l,mid);//分而治之
merge(c,mid+1,r);
int k=0,i=l,j=mid+1;
while(i<=mid&&j<=r)
{
if(c[i]>c[j])tmp[k++]=c[j++];
else tmp[k++]=c[i++];
}
while(i<=mid)tmp[k++]=c[i++];
while(j<=r)tmp[k++]=c[j++];
for(i=l,j=0;i<=r;j++,i++)
c[i]=tmp[j];
}
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&c[i]);
merge(c,0,n-1);
quick(c,0,n-1);
sort(c,c+n);//库函数
for(int i=0;i<n;i++)
printf("%d",c[i]);
return 0;
}