#include<stdio.h>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;
void merge(int a[],int left,int mid,int right)
{
int L[100]= {0},R[100]= {0};
int n1=mid-left;
int n2=right-mid;
for(int k=0; k<n1; k++)
L[k]=a[left+k];
for(int k=0; k<n2; k++)
R[k]=a[mid+k];
L[n1]=R[n2]=INF;///在L,R,末尾安插一个无穷大,防止两个标记相比较,
/// 又防止循环i,j 分别超过n1,n2;
int i=0,j=0;
for(int k=left; k<right; k++)
{
if(L[i]<=R[j])
a[k]=L[i++];
else
a[k]=R[j++];
}
}
void mergesort(int a[],int left,int right)///left指开头,right指末尾加1
{
if(left+1<right)
{
int mid=(left+right)/2;
mergesort(a,left,mid);
mergesort(a,mid,right);
merge(a,left,mid,right);
}
}
int main()
{
int n;
int a[100];
scanf("%d",&n);
for(int i=0; i<n; i++)
scanf("%d",&a[i]);
mergesort(a,0,n);
for(int i=0; i<n; i++)
printf("%d ",a[i]);
printf("\n");
return 0;
}