#include <bits/stdc++.h>
using namespace std;
bool check(int x, int pos) { return (bool)(x & (1 << pos)); }
int st(int x, int pos) { return x = x | (1 << pos); }
int Reset(int x, int pos) { return x = x & ~(1 << pos); }
int main() {
  int test;
  cin >> test;
  for (int cs = 1; cs <= test; cs++) {
    vector<long long> neg, pos;
    neg.clear();
    pos.clear();
    long long n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      long long a;
      cin >> a;
      if (a < 0)
        neg.push_back(-a);
      else
        pos.push_back(a);
    }
    sort(pos.rbegin(), pos.rend());
    sort(neg.rbegin(), neg.rend());
    long long mx = -1000000000000000000, s = 1, nn = neg.size(),
              pp = pos.size();
    for (long long i = -1; i < min(5LL, nn); i++) {
      if (i != -1) s *= neg[i];
      long long ans = s;
      long long c = 0;
      for (long long j = 0; j < min(5LL, pp); j++) {
        if (j + i + 2 > 5) break;
        ans *= pos[j];
        c++;
      }
      if (i + c + 1 == 5) {
        if ((i + 1) % 2)
          mx = max(mx, -ans);
        else
          mx = max(mx, ans);
      }
    }
    sort(neg.begin(), neg.end());
    if (neg.size() >= 5) {
      s = 1;
      for (long long i = 0; i < 5; i++) {
        s *= neg[i];
      }
      mx = max(mx, -s);
    }
    cout << mx << endl;
  }
}
