#include <bits/stdc++.h>
long long int dx[] = {-2, -2, -1, 1, 2, 2, 1, -1};
long long int dy[] = {-1, 1, 2, 2, 1, -1, -2, -2};
using namespace std;
bool comp(long long int x, long long int y) { return abs(x) > abs(y); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int te = 1;
  cin >> te;
  while (te--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int mxi = -INT_MAX;
    for (long long int i = 0; i < n; i++) cin >> arr[i], mxi = max(mxi, arr[i]);
    sort(arr, arr + n, comp);
    if (mxi < 0) {
      cout << arr[n - 1] * arr[n - 2] * arr[n - 3] * arr[n - 4] * arr[n - 5]
           << "\n";
      continue;
    }
    long long int ans = arr[0] * arr[1] * arr[2] * arr[3] * arr[4];
    if (ans < 0) {
      for (long long int i = 5; i < n; i++) {
        for (long long int j = 0; j < 5; j++) {
          long long int tmp = arr[i];
          for (long long int k = 0; k < 5; k++) {
            if (k != j) tmp *= arr[k];
          }
          ans = max(ans, tmp);
        }
      }
    }
    cout << ans << endl;
  }
}
