#include<bits/stdc++.h>
using namespace std;
int main(){
int t,n,x,y; cin >> t;
while(t--){
cin >> n;
multiset<int>s;
bool found = false;
for(int i=0;i<n;i++){
cin >> x;
s.insert(x);
}
if(s.size() == 3) cout << "1 1\n";
else{
for(auto it=s.begin();it!=s.end();++it){
if(s.find((n-2) / *it) != s.end() && s.find((n-2) / *it) != it){
cout << *it << " " << (n-2) / *it << endl;
break;
}
}
}
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CglpbnQgdCxuLHgseTsJY2luID4+IHQ7Cgl3aGlsZSh0LS0pewoJCWNpbiA+PiBuOwoJCW11bHRpc2V0PGludD5zOwoJCWJvb2wgZm91bmQgID0gZmFsc2U7CgkJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJCWNpbiA+PiB4OwoJCQlzLmluc2VydCh4KTsKCQl9CgkJaWYocy5zaXplKCkgPT0gMykJY291dCA8PCAiMSAxXG4iOwoJCWVsc2V7CgkJCWZvcihhdXRvIGl0PXMuYmVnaW4oKTtpdCE9cy5lbmQoKTsrK2l0KXsKCQkJCWlmKHMuZmluZCgobi0yKSAvICppdCkgIT0gcy5lbmQoKSAmJiBzLmZpbmQoKG4tMikgLyAqaXQpICE9IGl0KXsKCQkJCQljb3V0IDw8ICppdCA8PCAiICIgPDwgKG4tMikgLyAqaXQgPDwgZW5kbDsKCQkJCQlicmVhazsKCQkJCX0KCQkJfQoJCX0KCX0KCXJldHVybiAwOwp9