#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       mem(b,0);
       int n,cnt = 0;
       double imin;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i)scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1)
                continue;
            if(b[a[i]]>=4){
                flag = 1;
                j = i;
                break;
            }
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = 1.0*a[i]/(double)t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(1.0*a[i]/(double)t<imin){
                    j = k;
                    k = i;
                    imin = 1.0*a[i]/(double)t;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
int a[10000];
int b[1000000];
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,p=0,i;
        memset(a,0,sizeof(a));
        scanf("%d",&n);
        for(i=1; i<=n; i++)
        {
            int m;
            scanf("%d",&m);
            a[m]++;
            if(a[m]==2||a[m]==4)
                b[++p]=m;
        }
        sort(b+1,b+1+p);
        int x,y;
        double minn=inf;
        for(i=1; i<p; i++)
        {
            if(b[i]==b[i+1])
            {
                x=b[i],y=b[i+1];
                break;
            }
            double m=b[i+1]*1.0/b[i];
            if(m<minn){minn=m;x=b[i];y=b[i+1];}
        }
        printf("%d %d %d %d\n",x,x,y,y);
    }
    return 0;
}


#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
int a[10000];//ÿ�����ݴ�С������1e4
int b[1000000];//�ܹ���1e6������
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,p=0,i;
        memset(a,0,sizeof(a));//һ�㳬ʱ���ܻ���memset��ԭ�򣬸ĳ�������û������
        scanf("%d",&n);
        for(i=1; i<=n; i++)
        {
            int m;
            scanf("%d",&m);
            a[m]++;
            if(a[m]==2||a[m]==4)//���ǳ�����4�λ���2�εĶ��ӽ�ȥ������������
                b[++p]=m;
        }
        sort(b+1,b+1+p);
        int x,y;
        double minn=inf;//������ô���һ����������Ƚϣ���wa�Ź�
        for(i=1; i<p; i++)
        {
            if(b[i]==b[i+1])
            {
                x=b[i],y=b[i+1];//�����ȣ����ǳ����˴��ڵ���4�ε����
                break;
            }
            double m=b[i+1]*1.0/b[i];//�����Ǹ���ʽ������һ��P^2/S,�߳���a,b�Ļ�������4*(a/b+b/a+2);
            //��������ʽֻ�е�a==b��ʱ���ʽ�ų��������������ֻ�е�a��b���ĺܽ���ʱ�������
            if(m<minn){minn=m;x=b[i];y=b[i+1];}
        }
        printf("%d %d %d %d\n",x,x,y,y);
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    ios::sync_with_stdio(0);
    int T;
    cin >> T;
    while(T--){
       mem(b,0);
       int n,imin,cnt = 0;
       int j,k,t;
       cin >> n;
       for(int i=1;i<=n;++i) cin>>a[i],b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1)
                continue;
            if(b[a[i]]>=4){
                flag = 1;
                j = i;
                break;
            }
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = a[i]/t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(a[i]/t<imin){
                    j = k;
                    k = i;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             cout <<a[j]<<" "<<a[j]<<" ";
       else
             cout <<a[j]<<" "<<a[k]<<" ";
       }
       cout << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       for(int i=0;i<=10010;++i) b[i] = 0;
       int n,cnt = 0;
       double imin;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i)scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       //cout << "h"<<n << endl;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1)
                continue;
            if(b[a[i]]>=4){
                flag = 1;
                j = i;
                break;
            }
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = a[i]*1.0/t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(a[i]*1.0/t<imin){
                    j = k;
                    k = i;
                    imin = a[i]*1.0/t;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#define inf 0x3f3f3f3f
using namespace std;
int a[10000];//ÿ�����ݴ�С������1e4
int b[1000000];//�ܹ���1e6������
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,p=0,i;
        for(i=0;i<=10000;i++)a[i]=0;//һ�㳬ʱ���ܻ���memset��ԭ�򣬸ĳ�������û������
        scanf("%d",&n);
        for(i=1; i<=n; i++)
        {
            int m;
            scanf("%d",&m);
            a[m]++;
            if(a[m]==2||a[m]==4)//���ǳ�����4�λ���2�εĶ��ӽ�ȥ������������
                b[++p]=m;
        }
        sort(b+1,b+1+p);
        int x,y;
        double minn=inf;//������ô���һ����������Ƚϣ���wa�Ź�
        for(i=1; i<p; i++)
        {
            if(b[i]==b[i+1])
            {
                x=b[i],y=b[i+1];//�����ȣ����ǳ����˴��ڵ���4�ε����
                break;
            }
            double m=b[i+1]*1.0/b[i];//�����Ǹ���ʽ������һ��P^2/S,�߳���a,b�Ļ�������4*(a/b+b/a+2);
            //��������ʽֻ�е�a==b��ʱ���ʽ�ų��������������ֻ�е�a��b���ĺܽ���ʱ�������
            if(m<minn){minn=m;x=b[i];y=b[i+1];}
        }
        printf("%d %d %d %d\n",x,x,y,y);
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       int n,cnt = 0;
       double imin;
       int j = 0,k = 0,t = 0;
       scanf("%d",&n);
       for(int i=1;i<=n;++i) scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1){
                b[a[i]] = 0;
                continue;
            }
            if(b[a[i]]>=4){
                b[a[i]] = 0;
                flag = 1;
                j = i;
                break;
            }
            b[a[i]] = 0;
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = 1.0*a[i]/(double)t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(1.0*a[i]/(double)t<imin){
                    j = k;
                    k = i;
                    imin = 1.0*a[i]/(double)t;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010]={0};
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       int n,cnt = 0;
       double imin;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i)scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1){
                 b[a[i]] = 0;
                continue;
            }
            if(b[a[i]]>=4){
                 b[a[i]] = 0;
                flag = 1;
                j = i;
                break;
            }
            b[a[i]]  = 0;
            cnt++;
            if(cnt==1){
                j = i;
            }
            if(cnt==2){
                imin = a[i]*1.0/t;
                k = i;
            }
            if(cnt>2){
                if(a[i]*1.0/t<imin){
                    j = k;
                    k = i;
                    imin = a[i]*1.0/t;
                }
            }
            t = a[i];
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
int a[10000];//ÿ�����ݴ�С������1e4
int b[1000000];//�ܹ���1e6������
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,p=0,i;
         for(i=0;i<=10000;i++)a[i]=0;//һ�㳬ʱ���ܻ���memset��ԭ�򣬸ĳ�������û������
        scanf("%d",&n);
        for(i=1; i<=n; i++)
        {
            int m;
            scanf("%d",&m);
            a[m]++;
            if(a[m]==2||a[m]==4)//���ǳ�����4�λ���2�εĶ��ӽ�ȥ������������
                b[++p]=m;
        }
        sort(b+1,b+1+p);
        int x,y;
        double minn=inf;//������ô���һ����������Ƚϣ���wa�Ź�
        for(i=1; i<p; i++)
        {
            if(b[i]==b[i+1])
            {
                x=b[i],y=b[i+1];//�����ȣ����ǳ����˴��ڵ���4�ε����
                break;
            }
            double m=b[i+1]*1.0/b[i];//�����Ǹ���ʽ������һ��P^2/S,�߳���a,b�Ļ�������4*(a/b+b/a+2);
            //��������ʽֻ�е�a==b��ʱ���ʽ�ų��������������ֻ�е�a��b���ĺܽ���ʱ�������
            if(m<minn){minn=m;x=b[i];y=b[i+1];}
        }
        printf("%d %d %d %d\n",x,x,y,y);
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       int n,cnt = 0;
       double imin;
       int j = 0,k = 0,t = 0;
       scanf("%d",&n);
       for(int i=1;i<=n;++i) scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]!=2&&b[a[i]]!=4){
                b[a[i]] = 0;
                continue;
            }
            if(b[a[i]]==4){
                b[a[i]] = 0;
                flag = 1;
                j = i;
                break;
            }
            b[a[i]] = 0;
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = 1.0*a[i]/(double)t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(1.0*a[i]/(double)t<imin){
                    j = k;
                    k = i;
                    imin = 1.0*a[i]/(double)t;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#define inf 0x3f3f3f3f
using namespace std;
int a[10000];
int b[1000000];
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,p=0,i;
        memset(a,0,sizeof(a));
        scanf("%d",&n);
        for(i=1; i<=n; i++)
        {
            int m;
            scanf("%d",&m);
            a[m]++;
            if(a[m]==2||a[m]==4)
                b[++p]=m;
        }
        sort(b+1,b+1+p);
        int x,y;
        double minn=inf;
        for(i=1; i<p; i++)
        {
            if(b[i]==b[i+1])
            {
                x=b[i],y=b[i+1];
                break;
            }
            double m=b[i+1]*1.0/b[i];
            if(m<minn){minn=m;x=b[i];y=b[i+1];}
        }
        printf("%d %d %d %d\n",x,x,y,y);
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
        mem(b,0);
       int n,cnt = 0;
       double imin;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i)scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1){
                continue;
            }
            if(b[a[i]]>=4){
                flag = 1;
                j = i;
                break;
            }
            cnt++;
            if(cnt==1){
                j = i;
            }
            if(cnt==2){
                imin = a[i]*1.0/t;
                k = i;
            }
            if(cnt>2){
                if(a[i]*1.0/t<imin){
                    j = k;
                    k = i;
                    imin = a[i]*1.0/t;
                }
            }
            t = a[i];
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       int n,cnt = 0;
       double imin;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i) scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]!=2&&b[a[i]]!=4){
                b[a[i]] = 0;
                continue;
            }
            if(b[a[i]]==4){
                b[a[i]] = 0;
                flag = 1;
                j = i;
                break;
            }
            b[a[i]] = 0;
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = 1.0*a[i]/(double)t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(1.0*a[i]/(double)t<imin){
                    j = k;
                    k = i;
                    imin = 1.0*a[i]/(double)t;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       mem(b,0);
       int n,cnt = 0;
       double imin;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i)scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1)
                continue;
            if(b[a[i]]>=4){
                flag = 1;
                j = i;
                break;
            }
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = 1.0*a[i]/(double)t+1.0*t/(double)a[i];
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(imin-(1.0*a[i]/(double)t+1.0*t/(double)a[i])>=1e-6){
                    j = k;
                    k = i;
                    imin = 1.0*a[i]/(double)t+1.0*t/(double)a[i];
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1000010;
int a[maxn];
int b[10010];
int main(){
    int T;
    scanf("%d",&T);
    while(T--){
       mem(b,0);
       int n,cnt = 0;
       double imin = inf;
       int j,k,t;
       scanf("%d",&n);
       for(int i=1;i<=n;++i)scanf("%d",&a[i]),b[a[i]]++;
       sort(a+1,a+1+n);
       n = unique(a+1,a+1+n)-a-1;
       int flag = 0;
       for(int i=1;i<=n;++i){
            if(b[a[i]]==1)
                continue;
            if(b[a[i]]>=4){
                flag = 1;
                j = i;
                break;
            }
            cnt++;
            if(cnt==1){
                t = a[i];
                j = i;
            }
            if(cnt==2){
                imin = 1.0*a[i]/t;
                k = i;
                t = a[i];
            }
            if(cnt>2){
                if(1.0*a[i]/t<imin){
                    j = k;
                    k = i;
                    imin = 1.0*a[i]/t;
                }
                t = a[i];
            }
       }
       for(int i=1;i<=2;++i){
        if(flag)
             printf("%d %d ",a[j],a[j]);
       else
             printf("%d %d ",a[j],a[k]);
       }
       printf("\n");
    }
    return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
		int n,t;
		cin>>t;
		int a[1000000],b;

		for(int i=0;i<t;i++)
		{
				int flag=0;
				float max=0.0;
				cin>>n;
				for(int j=0;j<n;j++)
						cin>>a[i];
				sort(a,a+n-1);
				for(int j=0;j<n;j++)
				{
						if(a[j+1]!=a[j])
								continue;
						for(int k=j+2;k<n;k++)
						{
								if(a[k]!=a[j])
								{
										if(k>=j+4)
										{
												cout<<a[j]<<" "<<a[j]<<" "<<a[j]<<" "<<a[j];
												flag=1;
												break;
										}
										if(a[k+1]!=a[k])
												continue;

										b=(float)a[j]/a[k];

										if(b>max)
												max=b;
										j=k-1;
										break;
								}
								if(flag=1)
										break;
						}
						if(flag!=1)
								cout<<max;

				}

		}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

		int n,t;
		cin>>t;
		int a[1000000],x,y;
		float b;

		for(int i=0;i<t;i++)
		{
//if(i!=t-1)
		cout<<endl;

				cin>>n;
				for(int j=0;j<n;j++)
						cin>>a[j];

				int flag =0;
				float max=0.0;
				float pr=0.000001;

			sort(&a[0],&a[n-1]);

				for(int j=0;j<n;j++)
				{

						if(a[j+1]!=a[j])
								continue;
						for(int k=j+2;k<n;k++)
						{

								if(a[k]!=a[j] || k>=j+4)
								{
										if(k>=j+4)
										{
												cout<<a[j]<<" "<<a[j]<<" "<<a[j]<<" "<<a[j];
										flag=2;
												break;
										}
										if(a[k+1]!=a[k])
										{
												continue;
										}

									b=(float)a[j]/a[k];

										if((b-max)>pr)
										{
												max=b;
												x=a[j];
												y=a[k];
										}
										j=k-1;
										break;
								}
						}

								if(flag==2)
								{

										break;
								}

				}
						if(flag!=2)
						{
						cout<<x<<" "<<x<<" "<<y<<" "<<y;

						}
		}

		return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{

		int n,t;
		cin>>t;
		int a[1000000],x,y;
		float b;

		for(int i=0;i<t;i++)
		{
if(i!=t-1)
		cout<<endl;

				cin>>n;
				for(int j=0;j<n;j++)
						cin>>a[j];

				int flag =0;
				float max=0.0;
				float pr=0.000001;

			sort(&a[0],&a[n-1]);

				for(int j=0;j<n;j++)
				{

						if(a[j+1]!=a[j])
								continue;
						for(int k=j+2;k<n;k++)
						{

								if(a[k]!=a[j] || k>=j+4)
								{
										if(k>=j+4)
										{
												cout<<a[j]<<" "<<a[j]<<" "<<a[j]<<" "<<a[j];
										flag=2;
												break;
										}
										if(a[k+1]!=a[k])
										{
												continue;
										}

									b=(float)a[j]/a[k];

										if((b-max)>pr)
										{
												max=b;
												x=a[j];
												y=a[k];
										}
										j=k-1;
										break;
								}
						}

								if(flag==2)
								{

										break;
								}

				}
						if(flag!=2)
						{
						cout<<x<<" "<<x<<" "<<y<<" "<<y;

						}
		}

		return 0;
}


#include<bits/stdc++11.h>
using namespace std;
int main()
{

		int n,t;
		cin>>t;
		int a[1000000],x,y;
		float b;

		for(int i=0;i<t;i++)
		{
//if(i!=t-1)
		cout<<endl;

				cin>>n;
				for(int j=0;j<n;j++)
						cin>>a[j];

				int flag =0;
				float max=0.0;
				float pr=0.000001;

			sort(&a[0],&a[n-1]);

				for(int j=0;j<n;j++)
				{

						if(a[j+1]!=a[j])
								continue;
						for(int k=j+2;k<n;k++)
						{

								if(a[k]!=a[j] || k>=j+4)
								{
										if(k>=j+4)
										{
												cout<<a[j]<<" "<<a[j]<<" "<<a[j]<<" "<<a[j];
										flag=2;
												break;
										}
										if(a[k+1]!=a[k])
										{
												continue;
										}

									b=(float)a[j]/a[k];

										if((b-max)>pr)
										{
												max=b;
												x=a[j];
												y=a[k];
										}
										j=k-1;
										break;
								}
						}

								if(flag==2)
								{

										break;
								}

				}
						if(flag!=2)
						{
						cout<<x<<" "<<x<<" "<<y<<" "<<y;

						}
		}

		return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
		ios_base::sync_with_stdio(false);
cin.tie(NULL);int t;
		int  a[1000000], c=0;
		float pr =0.000001,b[100000];

		cin>>t;
		for(int i=0;i<t;i++)
		{ int x,y,n;
				float max=0.0;

				c=0;
				cin>>n;
				for(int i=0;i<n;i++)
						cin>>a[i];

				sort(a,a+n);
				for(int i=0;i<n-1;i++)
				{

						if(a[i]==a[i+1])
						{				b[c]=a[i];

								c++;
								i++;

						}
				}
				bool f=1;
				for(int i=0;i<c-1;i++)
				{
						if(b[i]==b[i+1])
						{
								cout<<b[i]<<" "<<b[i]<<" "<<b[i]<<" "<<b[i]<<endl;
								f=0; break;
						}
						else
						{				if(max-(b[i]/b[i+1]) < pr)
								{
										max=b[i]/b[i+1];
										x=b[i],y=b[i+1];

								}
						}

				}
				if(!f) continue;
				cout<<x<<" "<<x<<" "<<y<<" "<<y<<endl;

		}

		return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{

		int n,t;
		cin>>t;
		int a[1000000],x,y;
		float b;

		for(int i=0;i<t;i++)
		{
//if(i!=t-1)
		cout<<endl;

				cin>>n;
				for(int j=0;j<n;j++)
						cin>>a[j];

				int flag =0;
				float max=0.0;
				float pr=0.000001;

			sort(&a[0],&a[n-1]);

				for(int j=0;j<n;j++)
				{

						if(a[j+1]!=a[j])
								continue;
						for(int k=j+2;k<n;k++)
						{

								if(a[k]!=a[j] || k>=j+4)
								{
										if(k>=j+4)
										{
												cout<<a[j]<<" "<<a[j]<<" "<<a[j]<<" "<<a[j];
										flag=2;
												break;
										}
										if(a[k+1]!=a[k])
										{
												continue;
										}

									b=(float)a[j]/a[k];

										if((b-max)>pr)
										{
												max=b;
												x=a[j];
												y=a[k];
										}
										j=k-1;
										break;
								}
						}

								if(flag==2)
								{

										break;
								}

				}
						if(flag!=2)
						{
						cout<<x<<" "<<x<<" "<<y<<" "<<y;

						}
		}

		return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    //Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
            if(a/(double)b + b/(double)a < minn){
                minn = a/(double)b + b/(double)a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    //Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        //me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
//            printf("arr[%d]:%d\n",i,arr[i]);
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
//            printf("a:%d b:%d val:%lf minn:%lf\n",a,b,a/(double)b + b/(double)a,minn);
            if(a/(double)b + b/(double)a < minn){
                minn = a/(double)b + b/(double)a;
                ans1 = a; ans2 = b;
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j-1,arr[j-1]);
//                printf("ans1:%d ans2:%d\n",ans1,ans2);
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
ios::sync_with_stdio(false);cin.tie(0);
    Case(T){
        cin >> n;
        //me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
//                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6 + 5;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//int n;
//int arr[maxn];
////vector<int> edge;
//int edge[maxn];
//
//int main()
//{
//#ifndef ONLINE_JUDGE
//    Fin;
//#endif // ONLINE_JUDGE
//    Case(T){
//        Scand(n);
//        me(arr,0);
//        me(edge, 0);
//        int Max = -1;
//        fo(i,0,n){
//            Scand(arr[i]);
//            edge[arr[i]]++;
//            Max = max(Max, arr[i]);
//        }
//        int minn = INF;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int firstt = 1;
//        fo(i, 1, Max+1){
//            if(edge[i] < 2)
//                continue;
//            if(edge[i] >= 4){
//                ans1 = ans2 = i;
//                break;
//            }
//            if(firstt){
//                a = i;
//                firstt = 0;
//                continue;
//            }
//            b = i;
//            if((b-a) < minn){
//                minn = b-a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

struct node{
    int val,num;
};

int n;
int arr[maxn];
vector<node> edge;

int main()
{
#ifndef ONLINE_JUDGE
    Fin;
#endif // ONLINE_JUDGE
    Case(T){
        cin >> n;
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        int ind = 0;
        while (ind < n) {
            node temp;
            temp.val = arr[ind];
            temp.num = 1;
            int k;
            for(k = ind+1; k < n; ++k)
                if(arr[ind] == arr[k])
                    temp.num++;
                else
                    break;
//            printf("val:%d num:%d\n",temp.val, temp.num);
            edge.push_back(temp);
            ind = k;
        }
        int len = edge.size();
//                printf("len:%d\n",len);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len){
//            printf("edge: i:%d val:%d num:%d\n",i,edge[i].val,edge[i].num);
            if(edge[i].num >= 4){
                ans1 = ans2 = edge[i].val;
                break;
            }
            if(edge[i].num < 2)
                break;
            if(i+1 < len && edge[i+1].val/edge[i].val-edge[i].val/edge[i+1].val < minn){
                minn = edge[i+1].val/edge[i].val-edge[i].val/edge[i+1].val;
                ans1 = edge[i].val; ans2 = edge[i+1].val;
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 5;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<int> edge;
int edge[maxn];

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
//        edge.clear();
        me(edge, 0);
//        int ind = 0;
        fo(i,0,n){
            Scand(arr[i]);
            edge[arr[i]]++;
        }
//        sort(arr, arr+n);
//        fo(i, 0, n-1){
////                        printf("arr:i:%d val:%d\n",i,arr[i]);
//            if(arr[i] == arr[i+1]){
//                edge[ind++] = arr[i];
//                i++;
//            }
//        }
//        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int firstt = 1;
        fo(i, 1, 10050){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i] < 2)
                continue;
            if(edge[i] >= 4){
                ans1 = ans2 = i;
                break;
            }
            if(firstt){
                a = i;
                firstt = 0;
                continue;
            }
            b = i;
            if((b-a) < minn){
                minn = b-a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6+6;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//
//int n;
//int arr[maxn];
////vector<node> edge;
//
//int main()
//{
//    ios::sync_with_stdio(false);cin.tie(0);
//    //Fin;
//    int T;
//    cin >> T;
//    while (T--){
//        cin >> n;
//        //me(arr,0);
//        fo(i,0,n){
//            cin >> arr[i];
//        }
//        sort(arr, arr+n);
//        double minn = 10000000000;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int startt = 1;
//        int j;
//        for(int i = 0; i < n; i = j){
//            int cnt = 1;
//            int flag = 0;
//            j = 0;
//            for(j = i+1; j < n; ++j)
//                if(arr[j] == arr[i]){
//                    cnt++;
//                    if(cnt == 4){
//                        ans1 = ans2 = arr[i];
//                        flag = 1;
//                        break;
//                    }
//                }else
//                    break;
//            if(flag)    break;
//            if(cnt == 1)
//                continue;
//            if(startt){
//                a = arr[i];
//                startt = 0;
//                continue;
//            }
//            b = arr[i];
//            if(a/(double)b + b/(double)a < minn){
//                minn = a/(double)b + b/(double)a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}

#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
       // me(arr,0);
        edge.clear();
        fo(i,0,n){
            Scand(arr[i]);
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
            //                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
        //        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
            //                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 5;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<int> edge;
int edge[maxn];

int main()
{
#ifndef ONLINE_JUDGE
    //Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
        me(edge, 0);
        int Max = -1;
        fo(i,0,n){
            Scand(arr[i]);
            edge[arr[i]]++;
            Max = max(Max, arr[i]);
        }
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int firstt = 1;
        fo(i, 1, Max+1){
            if(edge[i] < 2)
                continue;
            if(edge[i] >= 4){
                ans1 = ans2 = i;
                break;
            }
            if(firstt){
                a = i;
                firstt = 0;
                continue;
            }
            b = i;
            if((b-a) < minn){
                minn = b-a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e7 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
 // Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            Scand(arr[i]);
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
//                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e6+6;
double ans=1e18,pre;
int s[N],n,i,j,ans1,ans2;
int  main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int T;cin>>T;
    while(T--){
        cin>>n;
        for(i=1;i<=n;i++)cin>>s[i];
        sort(s+1,s+1+n);
        for(i=1,pre=-1;i<=n;i=j){
            for(j=i;s[j]==s[i]&&j<=n;j++);
            if(j-i>=4){ans=2;ans1=s[i];ans2=s[i];break;}
            if(j-i>=2&&pre>0&&pre/s[i]+s[i]/pre<ans){
                ans=pre/s[i]+s[i]/pre;
                ans1=pre;ans2=s[i];
            }
            if(j-i>=2)pre=s[i];
        }
        cout<<ans1<<" "<<ans1<<" "<<ans2<<" "<<ans2<<endl;
        ans=1e18;
    }
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    //Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        //me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
            if(a/(double)b + b/(double)a < minn){
                minn = a/(double)b + b/(double)a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6+6;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//
//int n;
//int arr[maxn];
////vector<node> edge;
//
//int main()
//{
//    ios::sync_with_stdio(false);cin.tie(0);
//    Fin;
//    int T;
//    cin >> T;
//    while (T--){
//        cin >> n;
//        //me(arr,0);
//        fo(i,0,n){
//            cin >> arr[i];
//        }
//        sort(arr, arr+n);
//        double minn = 10000000000;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int startt = 1;
//        int j;
//        for(int i = 0; i < n; i = j){
////            printf("arr[%d]:%d\n",i,arr[i]);
//            int cnt = 1;
//            int flag = 0;
//            j = 0;
//            for(j = i+1; j < n; ++j)
//                if(arr[j] == arr[i]){
//                    cnt++;
//                    if(cnt == 4){
//                        ans1 = ans2 = arr[i];
//                        flag = 1;
//                        break;
//                    }
//                }else
//                    break;
//            if(flag)    break;
//            if(cnt == 1)
//                continue;
//            if(startt){
//                a = arr[i];
//                startt = 0;
//                continue;
//            }
//            b = arr[i];
//            if(a/b + b/a < minn){
//                minn = a/b + b/a;
//                ans1 = a; ans2 = b;
////                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
    ios::sync_with_stdio(false);cin.tie(0);
    Case(T){
        cin >> n;
        //me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
            //                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
        //        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
            //                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e7 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<int> edge;
int edge[maxn];

int main()
{
#ifndef ONLINE_JUDGE
    //Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
//        edge.clear();
        me(edge, 0);
        int ind = 0;
        fo(i,0,n){
            Scand(arr[i]);
            edge[arr[i]]++;
        }
//        sort(arr, arr+n);
//        fo(i, 0, n-1){
////                        printf("arr:i:%d val:%d\n",i,arr[i]);
//            if(arr[i] == arr[i+1]){
//                edge[ind++] = arr[i];
//                i++;
//            }
//        }
//        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int firstt = 1;
        fo(i, 0, 1050){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i] < 2)
                continue;
            if(edge[i] >= 4){
                ans1 = ans2 = i;
                break;
            }
            if(firstt){
                a = i;
                firstt = 0;
                continue;
            }
            b = i;
            if((b-a) < minn){
                minn = b-a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6 + 5;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//int n;
//int arr[maxn];
////vector<int> edge;
//int edge[maxn];
//
//int main()
//{
//#ifndef ONLINE_JUDGE
//    Fin;
//#endif // ONLINE_JUDGE
//    Case(T){
//        Scand(n);
//        me(arr,0);
//        me(edge, 0);
//        int Max = -1;
//        fo(i,0,n){
//            Scand(arr[i]);
//            edge[arr[i]]++;
//            Max = max(Max, arr[i]);
//        }
//        int minn = INF;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int firstt = 1;
//        fo(i, 1, Max+1){
//            if(edge[i] < 2)
//                continue;
//            if(edge[i] >= 4){
//                ans1 = ans2 = i;
//                break;
//            }
//            if(firstt){
//                a = i;
//                firstt = 0;
//                continue;
//            }
//            b = i;
//            if((b-a) < minn){
//                minn = b-a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

struct node{
    int val,num;
};

int n;
int arr[maxn];
vector<node> edge;

int main()
{
#ifndef ONLINE_JUDGE
    //Fin;
#endif // ONLINE_JUDGE
    Case(T){
        cin >> n;
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int startt = 1;
        for(int i = 0; i < n; ++i){
            int cnt = 1;
            int flag = 0;
            int j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(arr[i]/(double)arr[j-1]+arr[j-1]/(double)arr[i] < minn){
                minn = arr[i]/(double)arr[j-1]+arr[j-1]/(double)arr[i];
                ans1 = arr[i]; ans2 = arr[j];
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
            }
            i = j-1;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<sstream>
using namespace std;
#define Fin            	   freopen("in.txt","r",stdin)
#define Fout           	   freopen("out.txt","w",stdout)
#define Case(T)        	   int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)      	   for(int i=a;i<b;i++)
#define fd(i,a,b)      	   for(int i=a;i>=b;i--)
#define mem(a,b) 	   	   memset(a,b,sizeof(a))
#define fill(a,l,b)    	   fill(a,a+l,b)
#define scand(n)       	   scanf("%d",&n)
#define scand2(m,n)        scanf("%d%d",&m,&n)
#define scand3(l,m,n)      scanf("%d%d%d",&l,&m,&n)
#define scand4(a,b,c,d)    scanf("%d%d%d%d",&a,&b,&c,&d)
#define scans(s)       	   scanf("%s",s)

#define inf 0x3f3f3f3f3f3f3f3f
#define ll long long
#define pi 3.14159265358979
#define MAXN 2000005
#define epx 1e-7

int a[1000005],b[10010],c[10010];

int main()
{
	Case(T)
	{
		mem(b,0);
		mem(c,0);
		int n;
		scand(n);
		fo(i,0,n)
			scand(a[i]);
		int maxi=0,flag=1;
		fo(i,0,n)
		{
			b[a[i]]++;
			if(b[a[i]]==4)
			{
				flag=0;
				printf("%d %d %d %d\n",a[i],a[i],a[i],a[i]);
				break;
			}
			maxi=max(a[i],maxi);
		}
		if(flag)
		{
			int len=0;
			fo(i,1,maxi+1)
			{
				if(b[i]>=2)
					c[len++]=i;
			}
			int a1,a2;
			a1=c[0];a2=c[1];
			int t1=a1,t2=a2;
			fo(i,1,len-1)
			{
				if(t2*c[i]>t1*c[i+1])
				{
					t1=c[i];t2=c[i+1];
					a1=c[i];a2=c[i+1];
				}
			}
			printf("%d %d %d %d\n",a1,a1,a2,a2);
		}
	}
	return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    //Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        fi(arr, n+5, 0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
            if(a/(double)b + b/(double)a < minn){
                minn = a/(double)b + b/(double)a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    //Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
//            printf("arr[%d]:%d\n",i,arr[i]);
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
            if(a/b + b/a < minn){
                minn = a/b + b/a;
                ans1 = a; ans2 = b;
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
    //Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            Scand(arr[i]);
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
//                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6+6;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//
//int n;
//int arr[maxn];
////vector<node> edge;
//
//int main()
//{
//    ios::sync_with_stdio(false);cin.tie(0);
//    Fin;
//    int T;
//    cin >> T;
//    while (T--){
//        cin >> n;
//        //me(arr,0);
//        fo(i,0,n){
//            cin >> arr[i];
//        }
//        sort(arr, arr+n);
//        double minn = 10000000000;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int startt = 1;
//        int j;
//        for(int i = 0; i < n; i = j){
////            printf("arr[%d]:%d\n",i,arr[i]);
//            int cnt = 1;
//            int flag = 0;
//            j = 0;
//            for(j = i+1; j < n; ++j)
//                if(arr[j] == arr[i]){
//                    cnt++;
//                    if(cnt == 4){
//                        ans1 = ans2 = arr[i];
//                        flag = 1;
//                        break;
//                    }
//                }else
//                    break;
//            if(flag)    break;
//            if(cnt == 1)
//                continue;
//            if(startt){
//                a = arr[i];
//                startt = 0;
//                continue;
//            }
//            b = arr[i];
//            if(a/b + b/a < minn){
//                minn = a/b + b/a;
//                ans1 = a; ans2 = b;
////                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
    ios::sync_with_stdio(false);cin.tie(0);
    Case(T){
        cin >> n;
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
            //                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
        //        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
            //                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 5;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<int> edge;
int edge[maxn];

int main()
{
#ifndef ONLINE_JUDGE
    //Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
//        edge.clear();
        me(edge, 0);
//        int ind = 0;
        fo(i,0,n){
            Scand(arr[i]);
            edge[arr[i]]++;
        }
//        sort(arr, arr+n);
//        fo(i, 0, n-1){
////                        printf("arr:i:%d val:%d\n",i,arr[i]);
//            if(arr[i] == arr[i+1]){
//                edge[ind++] = arr[i];
//                i++;
//            }
//        }
//        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int firstt = 1;
        fo(i, 1, 100500){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i] < 2)
                continue;
            if(edge[i] >= 4){
                ans1 = ans2 = i;
                break;
            }
            if(firstt){
                a = i;
                firstt = 0;
                continue;
            }
            b = i;
            if((b-a) < minn){
                minn = b-a;
                ans1 = a; ans2 = b;
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6 + 5;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//int n;
//int arr[maxn];
////vector<int> edge;
//int edge[maxn];
//
//int main()
//{
//#ifndef ONLINE_JUDGE
//    Fin;
//#endif // ONLINE_JUDGE
//    Case(T){
//        Scand(n);
//        me(arr,0);
//        me(edge, 0);
//        int Max = -1;
//        fo(i,0,n){
//            Scand(arr[i]);
//            edge[arr[i]]++;
//            Max = max(Max, arr[i]);
//        }
//        int minn = INF;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int firstt = 1;
//        fo(i, 1, Max+1){
//            if(edge[i] < 2)
//                continue;
//            if(edge[i] >= 4){
//                ans1 = ans2 = i;
//                break;
//            }
//            if(firstt){
//                a = i;
//                firstt = 0;
//                continue;
//            }
//            b = i;
//            if((b-a) < minn){
//                minn = b-a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

struct node{
    int val,num;
};

int n;
int arr[maxn];
vector<node> edge;

int main()
{
#ifndef ONLINE_JUDGE
    //Fin;
#endif // ONLINE_JUDGE
    Case(T){
        cin >> n;
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        int ind = 0;
        while (ind < n) {
            node temp;
            temp.val = arr[ind];
            temp.num = 1;
            int k;
            for(k = ind+1; k < n; ++k)
                if(arr[ind] == arr[k])
                    temp.num++;
                else
                    break;
//            printf("val:%d num:%d\n",temp.val, temp.num);
            edge.push_back(temp);
            ind = k;
        }
        int len = edge.size();
//                printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len){
//            printf("edge: i:%d val:%d num:%d\n",i,edge[i].val,edge[i].num);
            if(edge[i].num >= 4){
                ans1 = ans2 = edge[i].val;
                break;
            }
            if(edge[i].num < 2)
                break;
            if(i+1 < len && edge[i+1].val-edge[i].val < minn){
                minn = edge[i+1].val-edge[i].val;
                ans1 = edge[i].val; ans2 = edge[i+1].val;
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6+6;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//
//int n;
//int arr[maxn];
////vector<node> edge;
//
//int main()
//{
//    ios::sync_with_stdio(false);cin.tie(0);
//    //Fin;
//    int T;
//    cin >> T;
//    while (T--){
//        cin >> n;
//        //me(arr,0);
//        fo(i,0,n){
//            cin >> arr[i];
//        }
//        sort(arr, arr+n);
//        double minn = 10000000000;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int startt = 1;
//        int j;
//        for(int i = 0; i < n; i = j){
//            int cnt = 1;
//            int flag = 0;
//            j = 0;
//            for(j = i+1; j < n; ++j)
//                if(arr[j] == arr[i]){
//                    cnt++;
//                    if(cnt == 4){
//                        ans1 = ans2 = arr[i];
//                        flag = 1;
//                        break;
//                    }
//                }else
//                    break;
//            if(flag)    break;
//            if(cnt == 1)
//                continue;
//            if(startt){
//                a = arr[i];
//                startt = 0;
//                continue;
//            }
//            b = arr[i];
//            if(a/(double)b + b/(double)a < minn){
//                minn = a/(double)b + b/(double)a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}

#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
    Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
       me(arr,0);
        edge.clear();
        fo(i,0,n){
            Scand(arr[i]);
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
            //                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
        //        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
            //                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
vector<int> edge;

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
    Case(T){
        cin >> n;
        me(arr,0);
        edge.clear();
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
//                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge.push_back(arr[i]);
                i++;
            }
        }
        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, len-1){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e7 + 50;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<int> edge;
int edge[maxn];

int main()
{
#ifndef ONLINE_JUDGE
   // Fin;
#endif // ONLINE_JUDGE
    Case(T){
        Scand(n);
        me(arr,0);
//        edge.clear();
        me(edge, 0);
        int ind = 0;
        fo(i,0,n){
            Scand(arr[i]);
        }
        sort(arr, arr+n);
        fo(i, 0, n-1){
//                        printf("arr:i:%d val:%d\n",i,arr[i]);
            if(arr[i] == arr[i+1]){
                edge[ind++] = arr[i];
                i++;
            }
        }
//        int len = edge.size();
//        printf("len:%d\n",len);
        int minn = INF;
        int ans1 = 0, ans2 = 0;
        fo(i, 0, ind-1){
//                        printf("edge: i:%d val:%d\n",i,edge[i]);
            if(edge[i+1]-edge[i] < minn){
                minn = edge[i+1]-edge[i];
                ans1 = edge[i]; ans2 = edge[i+1];
            }
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6 + 5;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//int n;
//int arr[maxn];
////vector<int> edge;
//int edge[maxn];
//
//int main()
//{
//#ifndef ONLINE_JUDGE
//    Fin;
//#endif // ONLINE_JUDGE
//    Case(T){
//        Scand(n);
//        me(arr,0);
//        me(edge, 0);
//        int Max = -1;
//        fo(i,0,n){
//            Scand(arr[i]);
//            edge[arr[i]]++;
//            Max = max(Max, arr[i]);
//        }
//        int minn = INF;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int firstt = 1;
//        fo(i, 1, Max+1){
//            if(edge[i] < 2)
//                continue;
//            if(edge[i] >= 4){
//                ans1 = ans2 = i;
//                break;
//            }
//            if(firstt){
//                a = i;
//                firstt = 0;
//                continue;
//            }
//            b = i;
//            if((b-a) < minn){
//                minn = b-a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    //Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        for(int i = 0; i < n; ++i){
//            printf("arr[%d]:%d\n",i,arr[i]);
            int cnt = 1;
            int flag = 0;
            int j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                i = j-1;
                continue;
            }
            b = arr[i];
            if(a/b + b/a < minn){
                minn = a/b + b/a;
                ans1 = a; ans2 = b;
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
            }
            i = j-1;
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        //me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
//            printf("arr[%d]:%d\n",i,arr[i]);
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
            if(a/b + b/a < minn){
                minn = a/b + b/a;
                ans1 = a; ans2 = b;
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


//#include <map>
//#include <set>
//#include <stack>
//#include <cmath>
//#include <queue>
//#include <vector>
//#include <cstdio>
//#include <string>
//#include <cstring>
//#include <sstream>
//#include <iostream>
//#include <algorithm>
//#define Fin             freopen("in.txt","r",stdin)
//#define Fout            freopen("out.txt","w",stdout)
//#define Case(T)         int T;for(scanf("%d",&T);T--;)
//#define fo(i,a,b)              for(int i = a; i < b; ++i)
//#define fd(i,a,b)              for(int i = a; i >= b; --i)
//#define me(a,b) memset(a,b,sizeof(a))
//#define fi(a,n,val)    fill(a,a+n,val)
//#define Scand(n)       scanf("%d",&n)
//#define Scans(s)       scanf("%s",s)
//using namespace std;
//typedef long long ll;
//ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
//const int maxn = 1e6 + 5;
//const int INF = 0xffffff;
//
//#ifndef ONLINE_JUDGE
//
//#endif // ONLINE_JUDGE
//
//int n;
//int arr[maxn];
////vector<int> edge;
//int edge[maxn];
//
//int main()
//{
//#ifndef ONLINE_JUDGE
//    Fin;
//#endif // ONLINE_JUDGE
//    Case(T){
//        Scand(n);
//        me(arr,0);
//        me(edge, 0);
//        int Max = -1;
//        fo(i,0,n){
//            Scand(arr[i]);
//            edge[arr[i]]++;
//            Max = max(Max, arr[i]);
//        }
//        int minn = INF;
//        int ans1 = 0, ans2 = 0;
//        int a = -1, b = -1;
//        int firstt = 1;
//        fo(i, 1, Max+1){
//            if(edge[i] < 2)
//                continue;
//            if(edge[i] >= 4){
//                ans1 = ans2 = i;
//                break;
//            }
//            if(firstt){
//                a = i;
//                firstt = 0;
//                continue;
//            }
//            b = i;
//            if((b-a) < minn){
//                minn = b-a;
//                ans1 = a; ans2 = b;
//            }
//            a = b;
//        }
//        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
//    }
//    return 0;
//}
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
   // Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int startt = 1;
        for(int i = 0; i < n; ++i){
            int cnt = 1;
            int flag = 0;
            int j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(arr[i]/(double)arr[j-1]+arr[j-1]/(double)arr[i] < minn){
                minn = arr[i]/(double)arr[j-1]+arr[j-1]/(double)arr[i];
                ans1 = arr[i]; ans2 = arr[j];
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
            }
            i = j-1;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#define Fin             freopen("in.txt","r",stdin)
#define Fout            freopen("out.txt","w",stdout)
#define Case(T)         int T;for(scanf("%d",&T);T--;)
#define fo(i,a,b)              for(int i = a; i < b; ++i)
#define fd(i,a,b)              for(int i = a; i >= b; --i)
#define me(a,b) memset(a,b,sizeof(a))
#define fi(a,n,val)    fill(a,a+n,val)
#define Scand(n)       scanf("%d",&n)
#define Scans(s)       scanf("%s",s)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b ? gcd(b,a%b): a; }
const int maxn = 1e6+6;
const int INF = 0xffffff;

#ifndef ONLINE_JUDGE

#endif // ONLINE_JUDGE

int n;
int arr[maxn];
//vector<node> edge;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
   // Fin;
    int T;
    cin >> T;
    while (T--){
        cin >> n;
        //me(arr,0);
        fo(i,0,n){
            cin >> arr[i];
        }
        sort(arr, arr+n);
        double minn = 10000000000;
        int ans1 = 0, ans2 = 0;
        int a = -1, b = -1;
        int startt = 1;
        int j;
        for(int i = 0; i < n; i = j){
//            printf("arr[%d]:%d\n",i,arr[i]);
            int cnt = 1;
            int flag = 0;
            j = 0;
            for(j = i+1; j < n; ++j)
                if(arr[j] == arr[i]){
                    cnt++;
                    if(cnt == 4){
                        ans1 = ans2 = arr[i];
                        flag = 1;
                        break;
                    }
                }else
                    break;
            if(flag)    break;
            if(cnt == 1)
                continue;
            if(startt){
                a = arr[i];
                startt = 0;
                continue;
            }
            b = arr[i];
            if(a/b + b/a < minn){
                minn = a/b + b/a;
                ans1 = a; ans2 = b;
//                printf("arr[%d]:%d arr[%d]:%d\n",i,arr[i],j,arr[j]);
            }
            a = b;
        }
        printf("%d %d %d %d\n",ans1,ans1,ans2,ans2);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 10001;
int t, n, i, j, x, y, k, q, a[maxn], b[maxn], c[maxn];
double s, m;
inline int read()
{
	int x = 0;
	char ch = getchar();
	while (ch < '0' || ch>'9') ch = getchar();
	while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
	return x;
}
int main()
{
	t = read();
	while (t > 0)
	{
		--t;
		n = read();
		m = 1e9;
		for (i = 1; i <= q; i++) a[c[i]] = 0;
		k = q = 0;
		for (i = 1; i <= n; i++)
		{
			x = read();
			++a[x];
			if (a[x] == 2) b[++k] = x;
			if (a[x] == 1) c[++q] = x;
		}
		sort(b + 1, b + k + 1);
		for (i = 1; i <= k; i++)
		{
			if (a[b[i]] > 3)
			{
				for (j = 1; j < 5; j++) printf("%d ", b[i]);
				m = 0;
				break;
			}
			if (i == k) break;
			s = b[i] + b[i + 1];
			s = 4 * s * s / (double(b[i]) * b[i+1]);
			if (s < m)
			{
				m = s;
				x = b[i];
				y = b[i + 1];
			}
		}
		if (m > 0) printf("%d %d %d %d", x, x, y, y);
		printf("\n");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int t;
int n , len = 0;
int a[1010100];
int cnt[20010];
int b[101010];
void work(){
	memset(cnt,0,sizeof(cnt));
	len = 0;
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]),cnt[a[i]]++;
	for (int i=1;i<=10010;i++)
	  if (cnt[i]>=4) {
	      printf("%d %d %d %d\n",i,i,i,i);
	      return;
	  }
	  else if (cnt[i]>=2) b[++len] = i;
	  sort(b+1,b+len+1);
	  printf("%d %d %d %d\n",b[1],b[1],b[2],b[2]);
	  return;
}

int main(){
	scanf("%d",&t);
	while (t--) work();
}


/*
 * @Author: Lenstar
 * @Date: 2019-11-24 11:05:51
 * @LastEditTime: 2019-11-24 11:43:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \C++\vjudge\贪心\F.cpp
*/
#include <bits/stdc++.h>
using namespace std;
#define M 1010
#define N 100010
inline int read() {
    int x=0;
    char ch=getchar();
    while (!isdigit(ch)) ch=getchar();
    while (isdigit(ch)) x=x*10+ch-'0',ch=getchar();
    return x;
}
int vis[M],val[N];
int main() {
    int T=read();
    while (T--) {
        int n=read(),cnt=0;
        memset(vis,0,sizeof(vis));
        for (int i=1;i<=n;i++) {
            int x=read();
            vis[x]++;
            if (vis[x]==2 || vis[x]==4) val[++cnt]=x;
        }
        sort(val+1,val+cnt+1);
        int a=1,b=0;
        for (int i=2;i<=cnt;i++) {
            if (val[i]*b<val[i-1]*a) a=val[i],b=val[i-1];
        }
        printf("%d %d %d %d\n",a,a,b,b);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#define eps 1e-9
using namespace std;
#define N 1000005
int T,n,num[10005],a[N],seq[N];
#define M(a) memset(a,0,sizeof a)
int main()
{
	scanf("%d",&T);
	while(T--)
	{
		int i,tot=0,ans=0; double pp=1e9; M(num);	scanf("%d",&n);
		for(i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);num[a[i]]++;
			if(num[a[i]]==2)seq[++tot]=a[i];if(num[a[i]]==4)seq[++tot]=a[i];
		} sort(seq+1,seq+tot+1);
		for(i=1;i<tot;i++)
		{
			if(seq[i]==seq[i+1]){ans=i;break;}
			double oo=(double)seq[i+1]/seq[i];
			if(pp>oo+eps) {pp=oo;ans=i;}
		}
		printf("%d %d %d %d\n",seq[ans],seq[ans],seq[ans+1],seq[ans+1]);
	}
}