#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int big = 2999999999999999999;
const long long int small = -2999999999999999999;
long long int n, m, a, b, c, u, v, p, q, k;
void in2(long long int& a, long long int& b) {
  scanf("%lld", &a);
  ;
  scanf("%lld", &b);
  ;
}
void in3(long long int& a, long long int& b, long long int& c) {
  scanf("%lld", &a);
  ;
  scanf("%lld", &b);
  ;
  scanf("%lld", &c);
  ;
}
int main() {
  long long int t;
  scanf("%lld", &t);
  ;
  while (t--) {
    scanf("%lld", &n);
    ;
    vector<long long int> a(n);
    for (long long int i = 0; i < n; i++) scanf("%lld", &a[i]);
    ;
    sort(a.begin(), a.end());
    long long int c1 = a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5],
                  c2 = a[n - 1] * a[n - 2] * a[n - 3] * a[0] * a[1],
                  c3 = a[n - 1] * a[0] * a[1] * a[2] * a[3];
    long long int ans = max(c1, max(c2, c3));
    cout << ans << "\n";
  }
}
