#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long MOD = 1e+9 + 7;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const int INFi = 0x7f7f7f7f;
const long long N = 3e+5 + 7;
vector<long long> adj[N];
long long vis[N] = {};
int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};
int t = 1;
long long n;
vector<long long> v1, v2;
void MAIN() {
  cin >> n;
  v1.clear();
  v2.clear();
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (x >= 0)
      v1.push_back(x);
    else
      v2.push_back(-x);
  }
  sort((v1).begin(), (v1).end());
  reverse((v1).begin(), (v1).end());
  sort((v2).begin(), (v2).end());
  reverse((v2).begin(), (v2).end());
  long long len1 = v1.size();
  long long len2 = v2.size();
  if (len1 >= 5) {
    long long ans1 = 1;
    long long temp1 = -1e18;
    long long temp2 = -1e18;
    for (long long i = 0; i < 5; i++) ans1 *= v1[i];
    if (len2 >= 2) {
      temp1 = 1;
      for (long long i = 0; i < 2; i++) temp1 *= v2[i];
      for (long long i = 0; i < 3; i++) temp1 *= v1[i];
    }
    if (len2 >= 4) {
      temp2 = 1;
      for (long long i = 0; i < 4; i++) temp2 *= v2[i];
      for (long long i = 0; i < 1; i++) temp2 *= v1[i];
    }
    cout << max({ans1, temp1, temp2}) << "\n";
  } else if (len1 >= 4) {
    long long ans1 = 1;
    long long temp1 = -1e18;
    long long temp2 = -1e18;
    for (long long i = 0; i < 4; i++) ans1 *= v1[i];
    for (long long i = 0; i < 1; i++) ans1 *= -v2[i];
    if (len2 >= 2) {
      temp1 = 1;
      for (long long i = 0; i < 2; i++) temp1 *= v2[i];
      for (long long i = 0; i < 3; i++) temp1 *= v1[i];
    }
    if (len2 >= 4) {
      temp2 = 1;
      for (long long i = 0; i < 4; i++) temp2 *= v2[i];
      for (long long i = 0; i < 1; i++) temp2 *= v1[i];
    }
    cout << max({ans1, temp1, temp2}) << "\n";
  } else if (len1 >= 3) {
    long long temp1 = -1e18;
    long long temp2 = -1e18;
    if (len2 >= 2) {
      temp1 = 1;
      for (long long i = 0; i < 2; i++) temp1 *= v2[i];
      for (long long i = 0; i < 3; i++) temp1 *= v1[i];
    }
    if (len2 >= 4) {
      temp2 = 1;
      for (long long i = 0; i < 4; i++) temp2 *= v2[i];
      for (long long i = 0; i < 1; i++) temp2 *= v1[i];
    }
    cout << max({temp1, temp2}) << "\n";
  } else if (len1 >= 2) {
    long long ans = 1;
    long long temp1 = -1e18;
    long long temp2 = -1e18;
    temp1 = 1;
    for (long long i = 0; i < 3; i++) temp1 *= -v2[i];
    for (long long i = 0; i < 2; i++) temp1 *= v1[i];
    if (len2 >= 4) {
      temp2 = 1;
      for (long long i = 0; i < 4; i++) temp2 *= v2[i];
      for (long long i = 0; i < 1; i++) temp2 *= v1[i];
    }
    cout << max({temp1, temp2}) << "\n";
  } else if (len1 >= 1) {
    long long temp2 = 1;
    for (long long i = 0; i < 4; i++) temp2 *= v2[i];
    for (long long i = 0; i < 1; i++) temp2 *= v1[i];
    cout << temp2 << "\n";
  } else {
    long long ans = 1;
    sort((v2).begin(), (v2).end());
    for (long long i = 0; i < 5; i++) ans *= v2[i];
    cout << -ans << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  ;
  mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
  ;
  cin >> t;
  while (t--) {
    MAIN();
  }
}
