#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  long long int q = 0, p = 0, z = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] < 0)
      q++;
    else if (a[i] > 0)
      p++;
    else
      z++;
  }
  long long int m1, m2, m3, m4, m5;
  sort(a, a + n);
  m1 = a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5];
  m2 = a[n - 1] * a[n - 2] * a[n - 3] * a[0] * a[1];
  m3 = a[n - 1] * a[0] * a[1] * a[2] * a[3];
  long long int ans = max(m1, max(m2, m3));
  cout << ans << "\n";
}
int main() {
  ;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
}
