#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> pos, neg, a;
    for (int i = 0; i < n; i++) {
      long long x;
      cin >> x;
      a.push_back(x);
      if (x >= 0)
        pos.push_back(x);
      else
        neg.push_back(x);
    }
    sort((pos).begin(), (pos).end());
    reverse((pos).begin(), (pos).end());
    sort((neg).begin(), (neg).end());
    long long ans = 1;
    for (int i = 0; i < 5; i++) {
      ans *= a[i];
    }
    for (int m = 0; m <= 4 and m <= neg.size(); m += 2) {
      int p = 5 - m;
      if (p > pos.size()) continue;
      long long pro = 1;
      for (int i = 0; i < p; i++) pro *= pos[i];
      for (int i = 0; i < m; i++) pro *= neg[i];
      ans = max(ans, pro);
    }
    if (neg.size() >= 5) {
      reverse((neg).begin(), (neg).end());
      long long temp = 1;
      for (int i = 0; i < 5; i++) {
        temp *= neg[i];
      }
      ans = max(ans, temp);
    }
    cout << ans << endl;
  }
}
