#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second

#define sz(a) int((a).size())
#define all(a) (a).begin(), (a).end()

int n;

vector<int> solve(vector<int> a) {
   n = sz(a);
   vector<int> idx, ans(n);

   for (int i = 0; i < n; i++) {
      idx.push_back(i);
   }

   sort(all(idx), [&](int i, int j) {
      return a[i] < a[j];
   });

   for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
         ans[i / 2] = idx[i];
      } else {
         ans[n - i / 2 - 1] = idx[i];
      }
   }
   
   return ans;
}

#ifdef LOCAL
namespace grader {
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t ;
    for (int test=1; test<=t; test++) {
        int n;
        cin >> n ;
        vector <int> a(n);
        for (int i=0; i<n; i++) {
            cin >> a[i] ;
        }

        auto ans = solve(a);
        for (auto ind : ans) {
            cout << a[ind] << " ";
        }
        cout << endl;

        sort(all(ans));

        for (int i = 0; i < n; i++) {
           assert(i == ans[i]);
        }
    }
    cout << endl ;
    return 0;
}
};
signed main() {
   freopen("input.txt", "r", stdin);
   grader::main();
   return 0;
}
#endif
