#include<iostream>
#include<bits/stdc++.h>
using namespace std;
void sortpro(vector<int>& nums, int start, int end) {
if (start >= end)return;
int L = start, R = end;
int val = L + ((R - L) >> 1);
while (L <= R) {
while (L <= R && nums[L] < nums[val]) {
L++;
}
while (L <= R && nums[R] > nums[val]) {
R--;
}
if (L <= R)
{
swap(nums[L],nums[R]);
L++; R--;
}
}
sortpro(nums, start, R);
sortpro(nums, L, end);
}
int main()
{
int n; cin >> n;
vector<int>nums(n);
for (int i = 0; i < nums.size(); i++) {
cin >> nums[i];
}
sortpro(nums, 0, nums.size() - 1);
for (int i = 0; i < nums.size(); i++)
cout << nums[i] << " ";
return 0;
}