#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long x;
    vector<long long> a;
    for (long long int i = 0; i <= n - 1; i++) {
      cin >> x;
      a.push_back(x);
    };
    sort(a.begin(), a.end());
    if (a[n - 1] < 0) {
      cout << a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5] << "\n";
    } else if (a[n - 1] == 0) {
      cout << 0 << "\n";
    } else {
      int par;
      for (int i = 0; i < a.size(); i++) {
        if (a[i] >= 0) {
          par = i;
          break;
        }
      }
      int l = par - 1;
      int r = par;
      vector<int> b;
      while (l >= 0 and r < a.size()) {
        if (abs(a[l]) > a[r]) {
          b.push_back(a[r]);
          r++;
        } else if (abs(a[l]) < a[r]) {
          b.push_back(a[l]);
          l--;
        } else {
          b.push_back(a[l]);
          l--;
        }
      }
      while (l >= 0) {
        b.push_back(a[l]);
        l--;
      }
      while (r < a.size()) {
        b.push_back(a[r]);
        r++;
      }
      reverse(b.begin(), b.end());
      long long res = 1;
      for (long long int i = 0; i <= 4; i++) {
        res *= b[i];
      }
      for (long long int i = 5; i <= n - 1; i++) {
        for (int j = 0; j < 5; j++) {
          long long tmp = b[i];
          for (int k = 0; k < 5; k++) {
            if (k != j) tmp *= b[k];
          }
          res = max(res, tmp);
        }
      }
      cout << res << "\n";
    }
  }
  return 0;
}
