#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> arr(n);
    int neg = 0;
    int pos = 0;
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
      if (arr[i] < 0)
        neg++;
      else
        pos++;
    }
    sort(arr.begin(), arr.end());
    long long ans = 1;
    ans = arr[n - 1] * arr[n - 2] * arr[n - 3] * arr[n - 4] * arr[n - 5];
    ans = max(ans, arr[0] * arr[1] * arr[n - 1] * arr[n - 2] * arr[n - 3]);
    ans = max(ans, arr[0] * arr[1] * arr[2] * arr[3] * arr[n - 1]);
    cout << ans << endl;
  }
}
