include
include
using namespace std;
int n,a[100100],b[100100];
template
inline void read(type &x)
{
x=0;bool flag(0);char ch=getchar();
while(!isdigit(ch)) flag^=ch=='-',ch=getchar();
while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
flag?x=-x:0;
}
template
inline void write(type x,bool mode)
{
x<0?x=-x,putchar('-'):0;static short Stack[100],top(0);
do Stack[++top]=x%10,x/=10;while(x);
while(top) putchar(Stack[top--]|48);
mode?puts(""):putchar(' ');
}
void merge_sort(int l,int r)
{
if(l==r) return;
int mid=(l+r)>>1;
merge_sort(l,mid);
merge_sort(mid+1,r);
int t1=l,t2=mid+1;
for(int i=l;i<=r;i++)
{
if(t1>mid) b[i]=a[t2++];
else if(t2>r) b[i]=a[t1++];
else if(a[t1]<=a[t2]) b[i]=a[t1++];//若要从大到小排序,只需将这里的<=改为>即可
else b[i]=a[t2++];
}
for(int i=l;i<=r;i++) a[i]=b[i];
return;
}
signed main()
{
read(n);
for(int i=1;i<=n;i++) read(a[i]);
merge_sort(1,n);
for(int i=1;i<=n;i++) write(a[i],0);
return 0;
}