#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long i, n, a = 0, b = 0, c = 5, d, e, ans = 1;
    cin >> n;
    long long C[n];
    long long A[n];
    long long B[n];
    for (i = 0; i < n; i++) {
      cin >> C[i];
      if (C[i] < 0) {
        B[b] = -1 * C[i];
        b++;
      } else {
        A[a] = C[i];
        a++;
      }
    }
    sort(A, A + a);
    sort(B, B + b);
    vector<long long> R;
    if (a > 4)
      R.push_back(A[a - 1] * A[a - 2] * A[a - 3] * A[a - 4] * A[a - 5]);
    if (a > 3 && b > 0) R.push_back(A[0] * A[1] * A[2] * A[3] * B[0] * -1);
    if (a > 2 && b > 1)
      R.push_back(A[a - 1] * A[a - 2] * A[a - 3] * B[b - 1] * B[b - 2]);
    if (a > 1 && b > 2) R.push_back(A[0] * A[1] * B[0] * B[1] * B[2] * -1);
    if (a > 0 && b > 3)
      R.push_back(A[a - 1] * B[b - 4] * B[b - 3] * B[b - 1] * B[b - 2]);
    if (b > 4) R.push_back(B[0] * B[1] * B[2] * B[3] * B[4] * -1);
    sort(R.begin(), R.end());
    cout << R[R.size() - 1] << "\n";
  }
  return 0;
}
