#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T;
  cin >> T;
  for (long long h = 0; h < T; h++) {
    long long N, K, a, ans = 1;
    cin >> N;
    K = 5;
    vector<long long> A(0);
    vector<long long> B(0);
    for (long long i = 0; i < N; i++) {
      cin >> a;
      if (a >= 0) {
        A.push_back(a);
      } else {
        B.push_back(a);
      }
    }
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());
    sort(B.begin(), B.end());
    long long x = 0;
    long long y = 0;
    if (B.size() == 0) {
      for (long long i = 0; i < K; i++) {
        ans *= A.at(i);
      }
      cout << ans << endl;
      continue;
      return 0;
    }
    if (A.size() == 0) {
      if (K % 2 == 1) {
        for (long long i = 0; i < K; i++) {
          ans *= B.at((long long)B.size() - i - 1);
        }
      } else {
        for (long long i = 0; i < K; i++) {
          ans *= B.at(i);
        }
      }
      cout << ans << endl;
      continue;
      return 0;
    }
    if (N == K) {
      for (long long i = 0; i < (long long)A.size(); i++) {
        ans *= A.at(i);
      }
      for (long long i = 0; i < (long long)B.size(); i++) {
        ans *= B.at(i);
      }
      cout << ans << endl;
      continue;
      return 0;
    }
    for (long long i = 0; i < K; i++) {
      if (x == (long long)A.size()) {
        y++;
        continue;
      }
      if (y == (long long)B.size()) {
        x++;
        continue;
      }
      if (A.at(x) >= -1 * B.at(y)) {
        x++;
      } else {
        y++;
      }
    }
    if (x == 0) {
      if (y % 2 == 0) {
        for (long long i = 0; i < y; i++) {
          ans *= B.at(i);
        }
        cout << ans << endl;
        continue;
        return 0;
      } else {
        ans = A.at(0);
        for (long long i = 0; i < y - 1; i++) {
          ans *= B.at(i);
        }
        cout << ans << endl;
        continue;
        return 0;
      }
    }
    if (y == 0) {
      for (long long i = 0; i < x; i++) {
        ans *= A.at(i);
      }
      cout << ans << endl;
      continue;
      return 0;
    }
    if (y % 2 == 0) {
      for (long long i = 0; i < x; i++) {
        ans *= A.at(i);
      }
      for (long long i = 0; i < y; i++) {
        ans *= B.at(i);
      }
      cout << ans << endl;
      continue;
      return 0;
    } else {
      if (x == (long long)A.size()) {
        for (long long i = 0; i < x - 1; i++) {
          ans *= A.at(i);
        }
        for (long long i = 0; i < y + 1; i++) {
          ans *= B.at(i);
        }
        cout << ans << endl;
        continue;
        return 0;
      }
      if (y == (long long)B.size()) {
        for (long long i = 0; i < x + 1; i++) {
          ans *= A.at(i);
        }
        for (long long i = 0; i < y - 1; i++) {
          ans *= B.at(i);
        }
        cout << ans << endl;
        continue;
        return 0;
      }
      if (A.at(x) * A.at(x - 1) >= B.at(y) * B.at(y - 1)) {
        for (long long i = 0; i < x + 1; i++) {
          ans *= A.at(i);
        }
        for (long long i = 0; i < y - 1; i++) {
          ans *= B.at(i);
        }
        cout << ans << endl;
        continue;
        return 0;
      } else {
        for (long long i = 0; i < x - 1; i++) {
          ans *= A.at(i);
        }
        for (long long i = 0; i < y + 1; i++) {
          ans *= B.at(i);
        }
        cout << ans << endl;
        continue;
      }
    }
  }
}
