#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  int f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  x *= f;
}
int l[1000010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  read(t);
  while (t--) {
    int n;
    double m = 1e7;
    int id1, id2;
    read(n);
    for (int i = 0; i < n; i++) read(l[i]);
    sort(l, l + n);
    int last;
    for (int i = n - 1; i > 0; i--)
      if (l[i] == l[i - 1]) last = i;
    for (int i = last + 2; i < n; i++)
      if (l[i] == l[i - 1] && i - 1 > last) {
        if (l[i] * 1.0 / l[last] < m)
          m = l[i] * 1.0 / l[last], id1 = i, id2 = last;
        last = i;
      }
    printf("%d %d %d %d\n", l[id1], l[id1], l[id2], l[id2]);
  }
  return 0;
}
