#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long powermod(long long n, long long p, long long m) {
  if (p == 0)
    return 1;
  else if (p & 1)
    return n * powermod(n % m * n % m, p / 2, m) % m;
  return powermod(n % m * n % m, p / 2, m);
}
long long xsqrt(long long number) {
  long long x = sqrt(number);
  while (x * x < number) x++;
  while (x * x > number) x--;
  return x;
}
long long cbroot(long long number) {
  long long x = cbrt(number);
  while (x * x * x < number) x++;
  while (x * x * x > number) x--;
  return x;
}
long long power(long long n, long long p) {
  if (p == 0) return 1;
  if (p & 1) return n * power(n * n, p / 2);
  return power(n * n, p / 2);
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long pct = 0, nct = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] >= 0)
        pct++;
      else
        nct++;
    }
    long long pro = 1;
    if (n == 5) {
      for (long long i = 0; i < n; i++) pro *= a[i];
    } else {
      sort(a, a + n);
      if (pct) {
        long long pro1 = 1, pro2 = 1, pro3 = 1;
        for (long long i = n - 1; i >= n - 5; i--) pro1 *= a[i];
        for (long long i = n - 1; i >= n - 3; i--) pro2 *= a[i];
        for (long long i = 0; i <= 1; i++) pro2 *= a[i];
        for (long long i = 0; i <= 3; i++) pro3 *= a[i];
        pro3 *= a[n - 1];
        pro = max(pro1, max(pro2, pro3));
      } else {
        for (long long i = n - 1; i >= n - 5; i--) pro *= a[i];
      }
    }
    cout << pro << '\n';
  }
}
