#include<bits/stdc++.h>
#define maxn 200000
const double gold=0.6180339887498949;
using namespace std;
double a[maxn];
double ans[maxn];
int c[maxn];
int n;
void solve(int k){
int l=1,r=k-1;
int mid=(l+r)>>1;
while(l<r){
if(a[mid]/a[k]>gold) r=mid;
else l=mid+1;
mid=(l+r)>>1;
}
if(abs(a[l+1]/a[k]-gold)<abs(a[l]/a[k]-gold) )l++;
if(abs(a[l-1]/a[k]-gold)<abs(a[l]/a[k]-gold)) l--;//二分
ans[k]=abs(a[l]/a[k]-gold);
c[k]=l;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+n+1);
for(int i=2;i<=n;i++)
solve(i);
double Min=1;int point=0;
for(int i=2;i<=n;i++){
if(Min-ans[i]>=0.0000000001){
Min=ans[i];
point=i;
}
}
cout<<a[c[point]]<<endl;
cout<<a[point]<<endl;
return 0;
}