#include <bits/stdc++.h>
using namespace std;
vector<int> brr;
double cal(int a, int b) {
  return (double)a / (double)b + (double)b / (double)a;
}
int main() {
  int arr[1000003], brr[1000003];
  int t;
  cin >> t;
  while (t--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &arr[i]);
    }
    sort(arr, arr + n);
    int m = 0;
    for (int i = 0; i < n - 1; i++) {
      if (arr[i] == arr[i + 1]) {
        brr[m++] = arr[i];
        i++;
      }
    }
    int x, y;
    double ans = 999999999;
    for (int i = 0; i < m - 1; i++) {
      if (cal(brr[i], brr[i + 1]) < ans) {
        ans = cal(brr[i], brr[i + 1]);
        x = brr[i];
        y = brr[i + 1];
      }
    }
    printf("%d %d %d %d \n", x, x, y, y);
  }
}
