#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int 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[100005];
    long long neg = 0, pos = 0, zero = 0;
    for (long long i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    long long ch1 = a[0] * a[1] * a[2] * a[3] * a[n - 1];
    long long ch2 = a[0] * a[1] * a[n - 3] * a[n - 2] * a[n - 1];
    long long ch3 = a[n - 5] * a[n - 4] * a[n - 3] * a[n - 2] * a[n - 1];
    cout << max(ch1, max(ch2, ch3)) << endl;
  }
  return 0;
}
