#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; typedef unsigned long long ull; #include using namespace std; int main(){ int n; cin>>n; vector> A(n); rep(i,n){ int a; cin>>a; A[i]={a,i+1}; } sort(ALL(A)); vector B; if(n%2==0){ for(int i=0;i0;i-=2) B.push_back(A[i].second); } else{ for(int i=0;i0;i-=2) B.push_back(A[i].second); } vector C; rep(i,n) C.push_back(B[i]); rep(i,n) C.push_back(B[i]); int b=0; vector D; rep(i,2*n){ if(b==0 && C[i]!=1) continue; else if(b==0 && C[i]==1){ b=1; D.push_back(C[i]); } else if(b==1 && C[i]!=1){ D.push_back(C[i]); } else if(b==1 && C[i]==1){ D.push_back(C[i]); break; } } rep(i,n+1){ if(i) cout<<" "; cout<