program perde;
var
m:array [1..1000000] of integer;
i,n,m1,m2,m3,abs1,abs2,c,b:longint;
begin
readln(n);
if n<4 then begin
readln(m[1],m[2],m[3]);
writeln(m[1],' ',m[2],' ',m[3]);
end else begin
for i:=1 to n do read(m[i]);
m1:=-1;
abs1:=1;
for i:=1 to n do begin
if m[i]>m1 then begin
m1:=m[i];
c:=i;
end;
if (m[i]<0) and (m[i]<abs1) then begin
b:=i;
abs1:=m[i];
end;
end;
m[c]:=30001;m[b]:=30001;
m2:=-1;
abs2:=1;
for i:=1 to n do begin
if (m[i]<30001) and (m[i]>m2) then begin
c:=i;
m2:=m[i];
end;
if (m[i]<0) and (m[i]<abs2) then abs2:=m[i];
end;
m[c]:=30001;
m3:=-1;
for i:=1 to n do if (m[i]<30001) and (m[i]>m3) then m3:=m[i];
if (abs1=1) or (abs2=1) then writeln(m1,' ',m2,' ',m3);
if (abs2<>1) then begin
if (abs1*abs2>m1*m2) or (abs1*abs2>m2*m3) or (abs1*abs2>m1*m3)
then writeln(m1,' ',abs1,' ',abs2) else writeln(m1,' ',m2,' ',m3);
end;
end;
end.
