#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b != 0) {
    if (1 & b) res *= a;
    b >>= 1;
    a *= a;
  }
  return res;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> vv(n);
  for (long long i = 0; i < n; i++) {
    cin >> vv[i];
  }
  sort(begin(vv), end(vv));
  long long a, b, c;
  a = vv[0] * vv[1] * vv[2] * vv[3] * vv[n - 1];
  b = vv[0] * vv[1] * vv[n - 3] * vv[n - 2] * vv[n - 1];
  c = vv[n - 5] * vv[n - 4] * vv[n - 3] * vv[n - 2] * vv[n - 1];
  cout << max({a, b, c}) << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt;
  cin >> tt;
  while (tt--) {
    solve();
  }
  return 0;
}
