#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long ar[n];
  for (long long i = 0; i < n; i++) cin >> ar[i];
  sort(ar, ar + n);
  vector<long long> v, pos;
  long long ans = LLONG_MIN;
  for (long long i = 0; i < n; i++) {
    if (ar[i] != 0) {
      v.push_back(ar[i]);
      pos.push_back(abs(ar[i]));
    } else
      ans = 0;
  }
  if (v.size() >= 5) {
    long long siz = v.size();
    ans = max({ans, v[0] * v[1] * v[2] * v[3] * v[siz - 1],
               v[0] * v[1] * v[siz - 1] * v[siz - 2] * v[siz - 3],
               v[siz - 1] * v[siz - 2] * v[siz - 3] * v[siz - 4] * v[siz - 5]});
  }
  if (ans < 0 && pos.size() >= 5) {
    sort(pos.begin(), pos.end());
    long long temp = 1;
    for (long long i = 0; i < 5; i++) temp *= pos[i];
    ans = max(ans, -temp);
  }
  cout << ans << "\n";
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
