/*
#include<stdio.h>
#include<string.h>
#define SIZE 100
// push( 567 )
int stack[SIZE]= {};
int top=-1;
void push(int data)
{
top++;
stack[top]=data;
}
int pop()
{
return stack[top--];
}
int main()
{
int a;
char str[100]={};
scanf("%d\n", &a);
for(int i=0; i<a; i++)
{
gets(str);
if(str[0]=='p'&&str[1]=='u')
{
int num=0;
for(int j=6; str[j]!=' '; j++)
{
num=num*10+str[j]-'0';
}
push(num);
}
else if(str[0]=='p'&&str[1]=='o')
{
if(top!=-1)
pop();
}
else if(str[0]=='t'&&str[1]=='o')
{
if(top!=-1)
printf("%d\n", stack[top]);
else
printf("-1\n");
}
else if(str[0]=='s'&&str[1]=='i')
{
printf("%d\n", top+1);
}
else if(str[0]=='e'&&str[1]=='m')
{
if(top==-1)
printf("true\n");
else
printf("false\n");
}
}
}
*/
/*
#include<stdio.h>
#include<string.h>
#define SIZE 100000
char stack[SIZE]= {};
int top=0;
void push(int data)
{
top++;
stack[top]=data;
}
int pop()
{
return stack[top--];
}
int main()
{
char str[100001]={};
int sum=0;
gets(str);
for(int i=0; str[i]!=NULL; i++)
{
if(str[i]=='(')
push('(');
else if(str[i]==')'&&str[i-1]!=')')
{
pop();
sum=sum+top;
}
else if(str[i]==')'&&str[i-1]==')')
{
pop();
sum=sum+1;
}
}
printf("%d", sum);
}
*/
/*
#include <stdio.h>
int a[10001];
int n, i, j, temp, key;
int main() {
scanf("%d", &n);
for (i = 1; i <= n; i++)
scanf("%d", &a[i]);
for (i=2; i<=n; i++)
{
key=a[i];
for(j=i-1; key<a[j] && j>0; j--)
{
a[j+1]=a[j];
}
a[j+1]=key;
}
for (i=1; i<=n; i++)
printf("%d\n", a[i]);
return 0;
}
#include <stdio.h>
int a[100001];
void swap(int x, int y)
{
int t=a[x];
a[x]=a[y];
a[y]=t;
}
void qs(int s, int e) // a[s] ~ a[e]를 퀵정렬
{
if(s>=e) return ;
int pivot=s;
int low=s,high=e+1;
//pivot기준 오른쪽은 큰값만, 왼쪽은 작은값만 존재하도록
// while(low<high)
// {
// while(a[low]<a[pivot]) low++;
// while(a[high]>a[pivot]) high--;
// if(low<high) swap(low,high); //a[low] a[high] 교환
// }
do
{
do{ low++;}while(a[low]<a[pivot]);
do{ high--;}while(a[high]>a[pivot]);
if(low<high) swap(low,high); //a[low] a[high] 교환
}while(low<high);
swap(pivot,high);
//a[pivot] a[high] 교환
qs(s,high-1);
qs(high+1,e);
}
int main() {
int n, i, j;
scanf("%d", &n);
for (i = 1; i <= n; i++)
scanf("%d", &a[i]);
//quick_sort
qs(1,n);
for (i=1; i<=n; i++)
printf("%d\n", a[i]);
return 0;
}
*/
#include<stdio.h>
int a[100001];
void swap(int x, int y)
{
int data=a[x];
a[x]=a[y];
a[y]=data;
}
void qs(int s, int e)
{
if(s>=e) return ;
int pivot=s;
int low=s,high=e+1;
do
{ do{ high--; }while(a[pivot]<a[high]);
do{ low++; }while(a[pivot]>a[low]);
if(low<high) swap(low,high);}while(low<high);
swap(pivot,high);
qs(s,high-1);
qs(high+1,e);
}
int main()
{
int n, i, j;
scanf("%d", &n);
for(i=1; i<=n; i++)
scanf("%d", &a[i]);
qs(1,n);
for (i=1; i<=n; i++)
printf("%d\n", a[i]);
return 0;
}