#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("popcnt,avx2")
#define int long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define aint(a) (a).begin(),(a).end()
using namespace std;
const int maxn = 1e5 + 5;
int partition(vector<int>& a, int low, int high) {
int pivot = a[low];
int i = low - 1;
int j = high + 1;
while (1) {
i++;
while (a[i] < pivot) {
i++;
}
j--;
while (a[j] > pivot) {
j--;
}
if (i >= j) {
return j;
}
swap(a[i], a[j]);
}
}
void quick_sort(vector<int>& a, int low, int high) {
if (low >= high) {
return;
}
int pivot = partition(a, low, high);
quick_sort(a, pivot + 1, high);
quick_sort(a, low, pivot);
}
void solve() {
FILE* input = fopen("algsort.in", "r");
FILE* output = fopen("algsort.out", "w");
int n;
fscanf(input, "%d", &n);
vector<int> a(n);
for (int i = 0; i < n; i++) {
fscanf(input, "%d", &a[i]);
}
quick_sort(a, 0, n - 1);
for (int i = 0; i < n; i++) {
fprintf(output, "%d", a[i]);
}
}
int main() {
int t = 1;
// fin >> t;
while (t--) {
solve();
}
return 0;
}