#include <iostream>
#include <fstream>
#include <stdlib.h>
#define NMAX 500001
#define BUFF_SIZE 100001
using namespace std;
ifstream in("algsort.in");
ofstream out("algsort.out");
int A[NMAX], n, pos = 0;
char buff[BUFF_SIZE];
void Read(int &a)
{
while (!isdigit(buff[pos]))
if (++pos == BUFF_SIZE)
in.read(buff, BUFF_SIZE), pos = 0;
a = 0;
while (isdigit(buff[pos]))
{
a = a * 10 + (buff[pos] - '0');
if (++pos == BUFF_SIZE)
in.read(buff, BUFF_SIZE), pos = 0;
}
}
void quicksort(int x, int y)
{
if (x < y)
{
int i = x, j = y, pivot = A[(rand() % (y - x + 1)) + x];
while (i <= j)
{
while (A[i] < pivot)
i++;
while (A[j] > pivot)
j--;
if (i <= j)
{
swap(A[i], A[j]);
i++;
j--;
}
}
if (i < y)
quicksort(i, y);
if (j > x)
quicksort(x, j);
}
}
int main()
{
Read(n);
for (int i = 1; i <= n; i++)
Read(A[i]);
in.close();
quicksort(1, n);
for (int i = 1; i <= n; i++)
out << A[i] << " ";
out.close();
return 0;
}