#include #include #define repeat(i,n) for (int i = 0; (i) < int(n); ++(i)) using namespace std; int main() { int n; cin >> n; vector a(n); repeat (i,n) cin >> a[i]; repeat (i,2*n-3) { repeat (p,i+1) { int q = i - p; if (0 <= p and p < q and q <= n-1) { if (a[p] > a[q]) swap(a[p], a[q]); } } } repeat (i,n) cout << a[i] << ' '; cout << endl; return 0; }