#include #define PI 3.14159265359 #define NIL -1 using namespace std; const int64_t MOD = 1e9 + 7; int main() { int n; cin >> n; vector v(n); for (int i = 0; i < n; i++) { cin >> v.at(i); } for (int i = 1; i < 2 * n - 3; i++) { for (int j = 0; j <= i; j++) { int k = i - j; if (j >= k) continue; if (j >= n) continue; if (k >= n) continue; if (v.at(j) > v.at(k)) { int m = v.at(k); v.at(k) = v.at(j); v.at(j) = m; } } } for (int i = 0; i < n; i++) { if (i) cout << ' '; cout << v.at(i); } cout << endl; }