#include <bits/stdc++.h>
using namespace std;
const unsigned int mod = 1000000007;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    if (n <= 5) {
      long long int ans = 1;
      for (long long int i = 0; i < n; i++) {
        ans *= arr[i];
      }
      cout << ans << endl;
      continue;
    }
    sort(arr, arr + n);
    long long int ans1 = arr[0] * arr[1] * arr[2] * arr[3] * arr[n - 1];
    long long int ans2 = arr[0] * arr[1] * arr[n - 3] * arr[n - 2] * arr[n - 1];
    long long int ans3 =
        arr[n - 5] * arr[n - 4] * arr[n - 3] * arr[n - 2] * arr[n - 1];
    long long int ans = max(ans1, max(ans2, ans3));
    cout << ans << endl;
  }
}
