var i,n,m1,m2:longint;
a:array[0..100001] of longint;
f1,f2:text;
procedure sort(l,r:longint);
var i,j,x,t:longint;
begin
i:=l;j:=r;x:=a[(l+r) div 2];
repeat
while a[i] < x do inc(i);
while a[j] > x do dec(j);
if i<=j then
begin
t:=a[i];a[i]:=a[j];a[j]:=t;
inc(i);dec(j);
end;
until i>j;
if l<j then sort(l,j);
if i<r then sort(i,r);
end;
begin
assign(f1,'MAXF.INP');reset(f1);
assign(f2,'MAXF.OUT');rewrite(f2);
readln(f1,n);
for i:=1 to n do read(f1,a[i]);
sort(1,n);
m1:=0;m2:=1;
for i:=1 to n-1 do
if (a[i]<>a[i+1]) and (a[i+1]<>0) then
if a[i]/a[i+1]>m1/m2 then
begin
m1:=a[i];
m2:=a[i+1];
end;
writeln(f2,m1,' ',m2);
close(f1);close(f2);
end.