#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n;
long long a[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long> pos, neg;
    long long zero = 0;
    long long ans = -2e18;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] > 0)
        pos.push_back(a[i]);
      else if (a[i] < 0)
        neg.push_back(a[i]);
      else
        zero++;
    }
    if (zero > 0) ans = max(ans, 0LL);
    sort(pos.rbegin(), pos.rend());
    sort(neg.begin(), neg.end());
    for (long long i = 0; i <= (long long)pos.size() && i <= 5; i++) {
      long long j = 5 - i;
      if (j > neg.size()) continue;
      long long cur = 1;
      for (long long k = 0; k < i; k++) cur *= pos[k];
      for (long long k = 0; k < j; k++) cur *= neg[k];
      ans = max(ans, cur);
    }
    sort(neg.rbegin(), neg.rend());
    for (long long i = 0; i <= (long long)pos.size() && i <= 5; i++) {
      long long j = 5 - i;
      if (j > neg.size()) continue;
      long long cur = 1;
      for (long long k = 0; k < i; k++) cur *= pos[k];
      for (long long k = 0; k < j; k++) cur *= neg[k];
      ans = max(ans, cur);
    }
    cout << ans << "\n";
  }
  return 0;
}
