#include <iostream>
using namespace std;
#define long long int
int three_point_select(int &a, int &b, int &c){
if(a > b) swap(a, b);
if(a > c) swap(a, c);
if(b > c) swap(b, c);
return b;
}
void quick_sort(int arr[], int l, int r){
while(l < r + 1){
int x = l, y = r;
int z = three_point_select(
arr[x],
arr[y],
arr[(x + y) / 2]
);
do{
while(arr[x] < z) ++x;
while(arr[y] > z) --y;
if(x <= y){
swap(arr[x], arr[y]);
++x, --y;
}
} while(x <= y);
quick_sort(arr, l, y);
l = x;
}
}
int n, arr[100001];
signed main(){
cin >> n;
for(int i = 1; i <= n; i++) cin >> arr[i];
quick_sort(arr, 1, n);
for(int i = 1; i<= n; i++) cout << arr[i] << ' ';
return 0;
}