#include <bits/stdc++.h>
using namespace std;
const int NAX = 3e5 + 1;
const int INF = 1e9 + 1;
const long long UMAX = 2e18 + 1;
long long sm(long long n) {
  int res = 0;
  while (n > 0) {
    res += n % 10;
    n /= 10;
  }
  return res;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  vector<long long> ans;
  for (int i = 0; i < n; ++i) cin >> v[i];
  sort(v.begin(), v.end());
  long long p1 = v[0] * v[1] * v[2] * v[3] * v[n - 1];
  long long p2 = v[n - 1] * v[n - 2] * v[n - 3] * v[n - 4] * v[n - 5];
  long long p3 = v[0] * v[1] * v[n - 1] * v[n - 2] * v[n - 3];
  ans.push_back(p1);
  ans.push_back(p2);
  ans.push_back(p3);
  cout << *max_element(ans.begin(), ans.end()) << '\n';
  ;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
