#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug &operator<<(const c &) {
    return *this;
  }
};
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> make_pair;
  for (int i = 0; i < int(n); i++) {
    cin >> a[i];
    make_pair[a[i]]++;
  }
  long long res = 1;
  sort(a.begin(), a.end());
  if (n == 5) {
    for (int i = 0; i < n; ++i) {
      res *= a[i];
    }
  } else {
    if (make_pair.find(0) != make_pair.end()) {
      cout << max(0LL,
                  max(a[0] * a[1] * a[n - 3] * a[n - 2] * a[n - 1],
                      max(a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5],
                          a[0] * a[1] * a[2] * a[3] * a[n - 1])))
           << '\n';
      return;
    } else {
      cout << max(a[0] * a[1] * a[n - 3] * a[n - 2] * a[n - 1],
                  max(a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5],
                      a[0] * a[1] * a[2] * a[3] * a[n - 1]))
           << '\n';
      return;
    }
  }
  cout << res << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
