#include<iostream>
#include<queue>
#include<vector>
using namespace std;
int maxbit(int data[], int n)
{
int maxData = data[0];
for (int i = 1; i < n; ++i)
{
if (maxData < data[i])
maxData = data[i];
}
int d = 1;
int p = 10;
while (maxData >= p)
{
maxData /= 10;
++d;
}
return d;
}
void radixsort(int data[], int n)
{
int d = maxbit(data, n);
int* tmp = new int[n];
int* count = new int[10];
int i, j, k;
int radix = 1;
for (i = 1; i <= d; i++)
{
for (j = 0; j < 10; j++)
count[j] = 0;
for (j = 0; j < n; j++)
{
k = (data[j] / radix) % 10;
count[k]++;
}
for (j = 1; j < 10; j++)
count[j] = count[j - 1] + count[j];
for (j = n - 1; j >= 0; j--)
{
k = (data[j] / radix) % 10;
count[k]--;
tmp[count[k]] = data[j];
}
for (j = 0; j < n; j++)
data[j] = tmp[j];
radix = radix * 10;
}
delete[]tmp;
delete[]count;
}
int main() {
int n;
cin >> n;
int a[100000];
for (int i = 0; i < n; i++)
cin >> a[i];
radixsort(a, n);
for (int i = 0; i < n; i++) {
if (i)cout << " ";
cout << a[i];
}
}