#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, nigs = 0;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < 0) {
      nigs += 1;
    }
  }
  sort(a.begin(), a.end());
  vector<long long> negs;
  if (nigs > 3) {
    for (long long i = 0; i < 4; i++) {
      negs.push_back(a[i]);
    }
  } else if (nigs >= 2) {
    for (long long i = 0; i < 2; i++) {
      negs.push_back(a[i]);
    }
  }
  long long mx = 0, ans = 1;
  if (negs.size() == 0) {
    for (long long i = n - 1; i >= n - 5; i--) {
      ans *= a[i];
    }
    cout << ans << "\n";
    return;
  }
  long long temp = 1;
  if (negs.size() == 2) {
    for (long long i = n - 1; i >= n - 5; i--) {
      temp *= a[i];
    }
    ans = a[0] * a[1];
    for (long long i = n - 1; i >= n - 3; i--) {
      ans *= a[i];
    }
    cout << max(ans, temp) << "\n";
  }
  if (negs.size() == 4) {
    for (long long i = n - 1; i >= n - 5; i--) {
      temp *= a[i];
    }
    ans = a[0] * a[1];
    for (long long i = n - 1; i >= n - 3; i--) {
      ans *= a[i];
    }
    mx = a[0] * a[1] * a[2] * a[3] * a[n - 1];
    cout << max(max(mx, ans), temp) << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
