#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = (int)1e9 + 7;
bool cmp(ll a, ll b) { return abs(a) > abs(b); }
void solve() {
  int n;
  cin >> n;
  vector<ll> a(n);
  ll ans = 1, mx = -1e9;
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
    mx = max(a[i], mx);
  }
  sort((a).begin(), (a).end(), cmp);
  if (mx < 0) {
    ans = a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5];
    cout << ans << '\n';
    return;
  }
  ans = a[0] * a[1] * a[2] * a[3] * a[4];
  if (ans >= 0) {
    cout << ans << '\n';
    return;
  }
  for (ll i = 5; i < n; i++) {
    for (ll j = 0; j < 5; j++) {
      ll tmpAns = a[i];
      for (ll k = 0; k < 5; k++) {
        if (k != j) tmpAns *= a[k];
      }
      ans = max(ans, tmpAns);
    }
  }
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) {
    solve();
  }
  return 0;
}
