#include <bits/stdc++.h>
const int N = 1e4 + 10;
int n, cnt[N];
int q[N], tot;
bool v[N];
bool cmp(int a, int b) { return a < b; }
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    for (int i = 1; i <= 10000; i++) cnt[i] = 0;
    tot = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      int x;
      scanf("%d", &x);
      cnt[x]++;
      if (cnt[x] >= 2 && !v[x]) {
        v[x] = 1;
        q[++tot] = x;
      }
    }
    std::sort(q + 1, q + 1 + tot, cmp);
    int x, y;
    double ans = 1e9;
    for (int i = 1; i <= tot; i++) {
      if (cnt[q[i]] >= 4) {
        x = y = q[i];
        ans = 0;
      }
      if (i < tot && q[i] * 1.0 / q[i + 1] + q[i + 1] * 1.0 / q[i] < ans) {
        ans = q[i] * 1.0 / q[i + 1] + q[i + 1] * 1.0 / q[i];
        x = q[i];
        y = q[i + 1];
      }
      v[q[i]] = 0;
    }
    printf("%d %d %d %d\n", x, x, y, y);
  }
}
