#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
bool cmp(long long int x, long long int y) { return abs(x) < abs(y); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int a[n], i;
    long long int mx = -1e9;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    sort(a, a + n, cmp);
    if (mx < 0) {
      cout << a[0] * a[1] * a[2] * a[3] * a[4] << "\n";
      continue;
    }
    long long int ans;
    long long int j, k;
    ans = a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5];
    for (i = n - 6; i >= 0; i--) {
      for (j = n - 1; j >= n - 5; j--) {
        long long int tmp = a[i];
        for (k = n - 1; k >= n - 5; k--) {
          if (j != k) tmp *= a[k];
        }
        ans = max(ans, tmp);
      }
    }
    cout << ans << "\n";
  }
}
