var a,max1,max2,max3,min1,min2:integer;
    i,n:longint;
begin
readln(n);
read(a);
min1:=a;
min2:=a;
max1:=a;
max2:=a;
max3:=a;
for i:=1 to n-1 do
 begin
  read(a);
  if ((max1<=max2)and(max1<=max3))and(a>max1) then max1:=a
   else
     if ((max2<=max3)and(max2<=max1))and(a>max2) then max2:=a
      else
        if ((max3<=max2)and(max3<=max1))and(a>max3) then max3:=a;
  if (a<0)and((a<min1)and(min1>=min2)) then min1:=a
   else
      if (a<0)and((a<min2)and(min2>=min1)) then min2:=a;
 end;
if (max1>=max2)and(max1>=max3) then
                              if (abs(max2)<=abs(min1))and(abs(max3)<=abs(min2))
                               or(abs(max3)<=abs(min1))and(abs(max2)<=abs(min2)) then
                                         begin writeln(max1,' ',min1,' ',min2); exit;end
 else
  if (max2>=max3)and(max2>=max1) then
          if (abs(max1)<=abs(min1))and(abs(max3)<=abs(min2))
            or(abs(max3)<=abs(min1))and(abs(max1)<=abs(min2)) then
               begin writeln(max2,' ',min1,' ',min2); exit;end
 else
  if (max3>=max2)and(max3>=max1) then
          if (abs(max1)<=abs(min1))and(abs(max2)<=abs(min2))
            or(abs(max2)<=abs(min1))and(abs(max1)<=abs(min2)) then
              begin writeln(max3,' ',min1,' ',min2); exit; end;

writeln(max1,' ',max2,' ',max3);
end.


