#include <bits/stdc++.h>
int q, n, a, m1, m2, cnt[10004], best[2];
inline double calc(int x, int y) { return 4.0 * (x + y) * (x + y) / (x * y); }
signed main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cin >> q;
  while (q--) {
    std::cin >> n;
    std::multiset<int> set;
    for (int i = 0; i < (10004); ++i) cnt[i] = 0;
    best[0] = 1000000000;
    best[1] = 1;
    double bbb = calc(best[0], best[1]);
    for (int i = 0; i < (n); ++i) {
      std::cin >> a;
      cnt[a]++;
      if (cnt[a] == 2) {
        cnt[a] = 0;
        auto it = set.insert(a);
        if (it != set.begin() && calc(*std::next(it, -1), a) < bbb) {
          best[0] = *std::next(it, -1);
          best[1] = a;
          bbb = calc(best[0], best[1]);
        }
        if (std::next(it, 1) != set.end() && calc(*std::next(it, 1), a) < bbb) {
          best[0] = *std::next(it, 1);
          best[1] = a;
          bbb = calc(best[0], best[1]);
        }
      }
    }
    for (int i = 0; i < (2); ++i) std::cout << best[i] << " " << best[i] << " ";
    std::cout << "\n";
  }
  return 0;
}
