#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> neg;
    vector<long long> pos;
    bool zero = false;
    for (int i = 0; i < n; i++) {
      long long x;
      cin >> x;
      if (x > 0)
        pos.push_back(x);
      else if (x < 0)
        neg.push_back(x);
      else
        zero = true;
    }
    sort(pos.rbegin(), pos.rend());
    sort(neg.begin(), neg.end());
    long long ans = -1e18;
    bool done = false;
    if (pos.size() >= 5) {
      ans = max(ans, pos[0] * pos[1] * pos[2] * pos[3] * pos[4]);
      done = true;
    }
    if (neg.size() >= 2 && pos.size() >= 3) {
      ans = max(ans, neg[0] * neg[1] * pos[0] * pos[1] * pos[2]);
      done = true;
    }
    if (neg.size() >= 4 && pos.size() >= 1) {
      ans = max(ans, neg[0] * neg[1] * neg[2] * neg[3] * pos[0]);
      done = true;
    }
    int ns = neg.size();
    int ps = pos.size();
    if (neg.size() >= 3 && pos.size() >= 2) {
      ans = max(ans, pos[ps - 1] * pos[ps - 2] * neg[ns - 1] * neg[ns - 2] *
                         neg[ns - 3]);
      done = true;
    }
    if (neg.size() >= 1 && pos.size() >= 4) {
      ans = max(ans, pos[ps - 1] * pos[ps - 2] * pos[ps - 3] * pos[ps - 4] *
                         neg[ns - 1]);
      done = true;
    }
    if (neg.size() >= 5) {
      ans = max(ans, neg[ns - 1] * neg[ns - 2] * neg[ns - 3] * neg[ns - 4] *
                         neg[ns - 5]);
      done = true;
    }
    if (zero) ans = max(ans, (long long)0);
    cout << ans << "\n";
  }
}
