#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF (1LL<<25) //33554432 #define PI 3.14159265359 #define EPS 1e-12 //#define int ll int a[5010]; signed main(void) { int n; cin >> n; REP(i, n) cin >> a[i]; FOR(i, 1, 2*n-3) { //cout << i << endl; REP(p, i+1) { if(p >= i-p) break; if(i-p >= n) continue; //cout << "a[" << p << "]:" << a[p] << " a[" << i-p << "]:" << a[i-p] << endl; if(a[p] > a[i-p]) swap(a[p], a[i-p]); } //REP(j, n) cout << a[j] << " "; cout << endl; } REP(i, n) { cout << a[i]; if(i != n-1) cout << " "; } cout << endl; return 0; }