#include<iostream>
#include<algorithm>
using namespace std;
void insert_sort(int a[], int n) {
int i, j;
for (int i = 1; i < n; i++) {
int tem = a[i];
for (j = i; j > 0 && a[j - 1] > tem; j--)
a[j] = a[j - 1];
a[j] = tem;
}
}
void qsort1(int a[], int left, int right)
{
if (left < right) {
int i = left, j = right, x = a[left];
while (i < j) {
while (i < j && a[j] >= x)
j--;
if (i < j)
a[i++] = a[j];
while (i < j && a[i] < x)
i++;
if (i < j)
a[j--] = a[i];
}
a[i] = x;
qsort1(a, left, i - 1);
qsort1(a, i + 1, right);
}
}
int getcenter(int a[], int left, int right)
{
int center = (left + right) / 2;
if (a[left] > a[center])
swap(a[left], a[center]);
if (a[left] > a[right])
swap(a[left], a[right]);
if (a[center] > a[right])
swap(a[center], a[right]);
swap(a[center], a[right - 1]);
return a[right - 1];
}
void qsort2(int a[], int left, int right)
{
int cutoff = 500;
if (cutoff <= right - left) {
int pivot = getcenter(a, left, right);
int i = left,j = right - 1;
while (1) {
while (a[++i] < pivot);
while (a[--j] > pivot);
if (j <= i)
break;
swap(a[i], a[j]);
}
swap(a[i], a[right - 1]);
qsort2(a, left, i - 1);
qsort2(a, i + 1, right);
}
else
insert_sort(a + left, right - left + 1);
}
int main() {
int n;
int a[1000001];
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
qsort2(a, 0, n - 1);
for (int i = 0; i < n; i++) {
if (i)cout << " ";
cout << a[i];
}
}