#include <iostream>
using namespace std;
int n, a[1000005];
void mySort(int l, int r)
{
int i = l, j = r;
int mid = a[(i + j) / 2];
do
{
while (a[i] <= mid)i++;
while (a[j] >= mid)j--;
if (i < j)
{
swap(a[i],a[j]);
i++;
j--;
}
} while (i <= j);
if (l < j)mySort(l, j);
if (i < r)mySort(i, r);
}
int main()
{
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
mySort(0, n - 1);
for (int i = 0; i < n; i++)
{
cout << a[i] << " ";
}
return 0;
}