#include <bits/stdc++.h>
bool cmp(const int a, const int b) { return a > b; }
using namespace std;
int a[10005], b[10005];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    int n;
    scanf("%d", &n);
    int aa;
    int z = 0, flag = 0, temp;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &aa);
      a[aa]++;
      if (a[aa] >= 4) {
        flag = 1;
        temp = aa;
      } else if (a[aa] == 2) {
        b[z++] = aa;
      }
    }
    if (flag) {
      printf("%d %d %d %d\n", temp, temp, temp, temp);
      continue;
    }
    sort(b, b + z, cmp);
    double min = 9999999;
    int ans1 = 0, ans2 = 0;
    for (int i = 0; i < z - 1; i++) {
      if ((b[i] * 1.0) / (b[i + 1] * 1.0) < min) {
        min = (b[i] * 1.0) / (b[i + 1] * 1.0);
        ans1 = b[i];
        ans2 = b[i + 1];
      }
    }
    printf("%d %d %d %d\n", ans1, ans1, ans2, ans2);
  }
}
