#include <bits/stdc++.h>
const char nl = '\n';
using namespace std;
class Input {
 public:
  Input() {
    myPc();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ;
  }
  void myPc() {}
};
Input setup;
void solve(long long int tc) {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long int ans;
  ans = a[0] * a[1] * a[2] * a[3] * a[4];
  ans = max(ans, a[0] * a[1] * a[n - 1] * a[n - 2] * a[n - 3]);
  ans = max(ans, a[0] * a[1] * a[2] * a[3] * a[n - 1]);
  ans = max(ans, a[n - 1] * a[n - 2] * a[n - 3] * a[n - 4] * a[n - 5]);
  cout << ans;
}
int32_t main() {
  long long int tcc;
  tcc = 1;
  cin >> tcc;
  for (long long int i = 1; i <= tcc; i++) {
    solve(i);
    cout << "\n";
  }
}
