#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T v) {
  cout << v << "\n";
}
template <typename T>
void print(vector<T> a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> arr(n);
  bool x = false;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 0) {
      x = true;
    }
  }
  sort(arr.begin(), arr.end(), greater<long long>());
  long long finalAns = max(
      arr[0] * arr[1] * arr[2] * arr[3] * arr[4],
      max(arr[0] * arr[n - 1] * arr[n - 2] * arr[n - 3] * arr[n - 4],
          max(arr[n - 5] * arr[n - 1] * arr[n - 2] * arr[n - 3] * arr[n - 4],
              arr[0] * arr[1] * arr[2] * arr[n - 1] * arr[n - 2])));
  if (x) {
    finalAns = max(0 * 1LL, finalAns);
  }
  print(finalAns);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
