#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
void solve() {
  long long n;
  cin >> n;
  vector<long long> arr(n);
  long long mx = LLONG_MIN;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    mx = max(mx, arr[i]);
  }
  sort(arr.begin(), arr.end(),
       [](long long x, long long y) { return abs(x) > abs(y); });
  if (mx < 0) {
    cout << arr[n - 1] * arr[n - 2] * arr[n - 3] * arr[n - 4] * arr[n - 5]
         << endl;
    return;
  }
  long long res = arr[0] * arr[1] * arr[2] * arr[3] * arr[4];
  for (long long i = 5; i < n; i++) {
    for (long long j = 0; j < 5; j++) {
      long long new_res = arr[i];
      for (long long k = 0; k < 5; k++) {
        if (k != j) new_res *= arr[k];
      }
      res = max(res, new_res);
    }
  }
  cout << res << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
