#include <bits/stdc++.h>
using namespace std;
long long int solve() {
  int n;
  cin >> n;
  long long int arr[n];
  for (auto &x : arr) cin >> x;
  sort(arr, arr + n);
  long long int res =
      arr[n - 5] * arr[n - 4] * arr[n - 3] * arr[n - 2] * arr[n - 1];
  res = max(res, arr[0] * arr[1] * arr[n - 3] * arr[n - 2] * arr[n - 1]);
  res = max(res, arr[0] * arr[1] * arr[2] * arr[3] * arr[n - 1]);
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long T;
  cin >> T;
  while (T--) {
    cout << solve() << '\n';
  }
  return 0;
}
