//BInsertSort
#include<stdio.h>
#include<stdlib.h>
int a[10000001];
int n;
int Part(int a[],int low,int high)
{
int temp = a[low];
int p = a[low];
while(low<high)
{
while(low<high&&a[high]>=p)
--high;
a[low] = a[high];
while(low<high&&a[low]<=p)
++low;
a[high] = a[low];
}
a[low] = temp;
return low;
}
void Qsort(int a[],int low,int high)
{
if(low<high)
{
int p = Part(a,low,high);
Qsort(a,low,p-1);
Qsort(a,p+1,high);
}
}
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
Qsort(a,1,n);
for(int i=1;i<=n;i++)
printf("%d ",a[i]);
return 0;
}
07-15
1379