#include<bits/stdc++.h>
#include"partition.h"
using namespace std;
vector<int> solve(vector<int> a){
    int n=a.size();
    vector<int> ret;
    a.push_back(-1);
    sort(a.begin(),a.end());
    for(int i=1;i<=n;i++){
        if(i%2==0) ret.push_back(a[i]);
    }
    for(int i=n;i;i--){
        if(i%2==1) ret.push_back(a[i]);
    }
    return ret;
}