#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 3e5 + 5;
const long long INF = 1e18;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  auto getProduct = [&](long long start) -> long long {
    long long product = 1;
    for (long long i = 0; i < start; i++) {
      product *= a[i];
    }
    for (long long i = n - 5 + start; i < n; i++) {
      product *= a[i];
    }
    return product;
  };
  long long ans = -INF;
  for (long long i = 0; i < 5; i++) {
    long long cur = getProduct(i);
    ans = max(ans, cur);
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    solve();
  }
  return 0;
}
