#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int tst = 0; tst < t; tst++) {
    int n;
    cin >> n;
    vector<long long> allNums;
    for (int i = 0; i < n; i++) {
      long long curr;
      cin >> curr;
      allNums.push_back(curr);
    }
    sort(allNums.begin(), allNums.end());
    long long ans1 = allNums[n - 1] * allNums[n - 2] * allNums[n - 3] *
                     allNums[n - 4] * allNums[n - 5];
    long long ans2 = allNums[n - 1] * allNums[n - 2] * allNums[n - 3] *
                     allNums[1] * allNums[0];
    long long ans3 =
        (allNums[n - 1] * allNums[3] * allNums[2] * allNums[1] * allNums[0]);
    cout << max(ans1, max(ans2, ans3)) << endl;
  }
}
