#include <iostream>
#include <vector>
using namespace std;
void merge(vector<vector<int>>& temp, int cur, int low, int mid, int high) {
int i = low, j = mid + 1, k = low;
auto &curNums = temp[cur], &preNums = temp[!cur];
while (i <= mid && j <= high) {
curNums[k++] = preNums[i] <= preNums[j] ? preNums[i++] : preNums[j++];
}
while (i <= mid) {
curNums[k++] = preNums[i++];
}
while (j <= high) {
curNums[k++] = preNums[j++];
}
}
void mergeSort(vector<vector<int>>& temp, int cur, int low, int high) {
if (low >= high) {
return;
}
int mid = (low + high) / 2;
mergeSort(temp, !cur, low, mid);
mergeSort(temp, !cur, mid + 1, high);
merge(temp, cur, low, mid, high);
}
void mergeSort(vector<int>& nums) {
vector<vector<int>> temp(2, nums);
mergeSort(temp, 0, 0, nums.size() - 1);
nums = temp[0];
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; i++) {
cin >> nums[i];
}
mergeSort(nums);
for (int i = 0; i < n; i++) {
cout << nums[i] << ' ';
}
return 0;
}