import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(br.readLine());
int[] arr=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++)arr[i]=Integer.parseInt(st.nextToken());
Arrays.sort(arr);
int l=0;
int r=n-1;
int sum=Math.abs(arr[0]+arr[n-1]);
int ans1=arr[0];
int ans2=arr[n-1];
while(l<r){
int a=arr[l]+arr[r];
if(Math.abs(a)<sum){
sum=Math.abs(a);
ans1=arr[l];
ans2=arr[r];
}
if(a<0)l++;
else r--;
}
System.out.println(ans1+" "+ans2);
}
}
#투포인터