#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long a[maxn], b[maxn];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, cnt0 = 0, cnt1 = 0;
    scanf("%d", &n);
    long long tmp, ans = 1;
    for (int i = 0; i < n; i++) {
      scanf("%lld", &tmp);
      ans *= tmp;
      if (tmp < 0) {
        a[cnt0++] = -tmp;
      } else {
        b[cnt1++] = tmp;
      }
    }
    if (n == 5) {
      printf("%lld\n", ans);
      continue;
    } else {
      ans = 0;
    }
    sort(a, a + cnt0);
    sort(b, b + cnt1);
    if (cnt1 == 0) {
      ans = 1;
      for (int i = 0; i < 5; i++) {
        ans *= a[i];
      }
      printf("%lld\n", -ans);
    } else {
      tmp = 1;
      if (cnt1 >= 1 && cnt0 >= 4) {
        for (int i = cnt1 - 1; i > cnt1 - 2; i--) {
          tmp *= b[i];
        }
        for (int i = cnt0 - 1; i > cnt0 - 5; i--) {
          tmp *= a[i];
        }
        ans = max(ans, tmp);
      }
      tmp = 1;
      if (cnt1 >= 3 && cnt0 >= 2) {
        for (int i = cnt1 - 1; i > cnt1 - 4; i--) {
          tmp *= b[i];
        }
        for (int i = cnt0 - 1; i > cnt0 - 3; i--) {
          tmp *= a[i];
        }
        ans = max(ans, tmp);
      }
      tmp = 1;
      if (cnt1 >= 5) {
        for (int i = cnt1 - 1; i > cnt1 - 6; i--) {
          tmp *= b[i];
        }
        ans = max(ans, tmp);
      }
      printf("%lld\n", ans);
    }
  }
}
