#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

vector<int> solve(vector<int> A)
{
    vector<ll> v;
    for (int x : A) v.push_back(x);
    sort(v.begin(), v.end());

    vector<ll> v1, v2;
    while (!v.empty())
    {
        v1.push_back(v.back());
        v2.push_back(v.back());
        v.pop_back();
        v.pop_back();
    }

    vector<int> ans;
    for (ll x : v1) ans.push_back(x);
    for (ll x : v2) ans.push_back(x);

    return ans;
}