#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long int x, y, z;
  x = arr[n - 5] * arr[n - 4] * arr[n - 3] * arr[n - 2] * arr[n - 1];
  y = arr[0] * arr[1] * arr[n - 3] * arr[n - 2] * arr[n - 1];
  z = arr[0] * arr[1] * arr[2] * arr[3] * arr[n - 1];
  cout << max(x, max(y, z)) << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
