#include #define REP(i,n,N) for(int i=(n);i<(int) N;i++) using namespace std; int a[2017]; int main() { int n; cin>>n; REP(i,0,n) cin>>a[i]; REP(i,1,2*n-3){ REP(p,0,(i+1)/2){ if(i-p>=n) continue; if(a[p]>a[i-p]) swap(a[p],a[i-p]); } } cout<