#include <bits/stdc++.h>
using namespace std;
int T, n;
void run() {
  cin >> n;
  int a[100005];
  int num = 0;
  vector<pair<int, int> > ab;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) num++;
    ab.push_back(make_pair(abs(a[i]), a[i] > 0));
  }
  sort(ab.begin(), ab.end());
  long long ans = 1;
  if (n == 5 && num % 2 == 0 || num == 0) {
    ans *= -1;
    for (int i = 0; i < 5; i++) ans *= ab[i].first;
  } else {
    reverse(ab.begin(), ab.end());
    for (int i = 0; i < 5; i++) ans *= ab[i].first * (ab[i].second ? 1 : -1);
    if (ans < 0) {
      int i;
      for (i = 4; i >= 0; i--)
        if (ab[i].second == 0) break;
      ans /= ab[i].first;
      ans *= -1;
      for (i = 5; i < n; i++)
        if (ab[i].second == 1) break;
      if (i < n)
        ans *= ab[i].first;
      else
        ans = -1e9;
      long long ans1 = 1;
      for (int i = 0; i < 5; i++) ans1 *= ab[i].first * (ab[i].second ? 1 : -1);
      for (i = 4; i >= 0; i--)
        if (ab[i].second == 1) break;
      ans1 /= ab[i].first;
      for (i = 5; i < n; i++)
        if (ab[i].second == 0) break;
      if (i < n)
        ans1 *= ab[i].first * (-1);
      else
        ans1 = -1e9;
      ans = max(ans, ans1);
    }
  }
  cout << ans << endl;
}
int main() {
  cin >> T;
  while (T--) run();
  return 0;
}
