#include <bits/stdc++.h>
int T, n;
std::vector<int> a, b;
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(nullptr);
  std::cin >> T;
  while (T--) {
    std::cin >> n;
    a.clear();
    b.clear();
    int zero = 0;
    for (int i = 1, x; i <= n; ++i) {
      std::cin >> x;
      if (x == 0)
        ++zero;
      else if (x > 0)
        a.push_back(x);
      else
        b.push_back(x);
    }
    std::sort(a.begin(), a.end());
    std::sort(b.begin(), b.end());
    long long ans = zero ? 0 : -1e18;
    if (a.size() >= 5) {
      long long t = 1;
      for (int i = a.size() - 5; i < a.size(); ++i) t *= a[i];
      ans = std::max(ans, t);
    }
    if (a.size() >= 3 && b.size() >= 2) {
      long long t = 1;
      for (int i = a.size() - 3; i < a.size(); ++i) t *= a[i];
      for (int i = 0; i < 2; ++i) t *= b[i];
      ans = std::max(ans, t);
    }
    if (a.size() >= 1 && b.size() >= 4) {
      long long t = a.back();
      for (int i = 0; i < 4; ++i) t *= b[i];
      ans = std::max(ans, t);
    }
    if (b.size() >= 5) {
      long long t = 1;
      for (int i = b.size() - 5; i < b.size(); ++i) t *= b[i];
      ans = std::max(ans, t);
    }
    if (b.size() >= 3 && a.size() >= 2) {
      long long t = 1;
      for (int i = b.size() - 3; i < b.size(); ++i) t *= b[i];
      for (int i = 0; i < 2; ++i) t *= a[i];
      ans = std::max(ans, t);
    }
    if (b.size() >= 1 && a.size() >= 4) {
      long long t = b.back();
      for (int i = 0; i < 4; ++i) t *= a[i];
      ans = std::max(ans, t);
    }
    std::cout << ans << std::endl;
  }
  return 0;
}
