#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 1; i < 2 * n - 3; i++) { for (int p = 0; p <= min(i, n - 1); p++) { int q = i - p; if (q < 0 || q >= n || p >= q) continue; if (a[p] > a[q]) swap(a[p], a[q]); } } cout << a[0]; for (int i = 1; i < n; i++) { cout << " " << a[i]; } cout << endl; return 0; }