#include <iostream>
using namespace std;
const int maxn=10000;
int a[maxn];
int b[maxn];//用来保存合并后数组 然后整体 赋值给a
void merge(int left,int mid,int right)
{
int i=left;
int j=mid+1;
int k=0;
while(i<=mid&&j<=right)
{
if(a[i]<=a[j])
{
b[k++]=a[i++];//此处的k指向b的下一个空位置
}
else
{
b[k++]=a[j++];
}
}
while(i<=mid)
{
b[k++]=a[i++];
}
while(j<=right)
{
b[k++]=a[j++];
}
int q=left;
for(int i=0;i<k;++i)
{
a[q]=b[i];
q++;
}
}
void mergesort(int a[],int left,int right)
{
if(left<right)
{
int mid=(left+right)/2;
mergesort(a,left,mid);
mergesort(a,mid+1,right);
merge(left,mid,right);
}
else
{
return ;
}
}
int main()
{
int n;
cin>>n;
for(int i=0;i<n;++i)
{
cin>>a[i];
}
mergesort(a,0,n-1);
for(int i=0;i<n;++i)
cout<<a[i]<<endl;
}