#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(NULL);
  long long t;
  cin >> t;
  for (long long q = 0; q < t; ++q) {
    long long n;
    cin >> n;
    vector<long long> a;
    vector<long long> b;
    for (long long i = 0; i < n; ++i) {
      long long x;
      cin >> x;
      if (x >= 0) {
        a.push_back(x);
      } else {
        b.push_back(x);
      }
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    reverse(b.begin(), b.end());
    long long ans = -1000000000000000000;
    for (long long i = 0; i <= 5; ++i) {
      if (a.size() >= i && b.size() >= 5 - i) {
        long long e = 1;
        if (i % 2 == 0) {
          for (long long j = 0; j < i; ++j) {
            e *= a[j];
          }
        } else {
          for (long long j = 0; j < i; ++j) {
            e *= a[a.size() - 1 - j];
          }
        }
        if (i % 2 == 0) {
          for (long long j = 0; j < 5 - i; ++j) {
            e *= b[j];
          }
        } else {
          for (long long j = 0; j < 5 - i; ++j) {
            e *= b[b.size() - 1 - j];
          }
        }
        ans = max(ans, e);
      }
    }
    cout << ans << "\n";
  }
}
