type
mas=array[3..1000000] of real;
var
i,n:integer;a,b,c:real;
begin
 readln(n);
 for i:=1 to n do
 if mas[i]<30 000 then begin
 if mas[i]>mas[i+1]
 then a:=mas[i]
 else a:=mas[i+1];
 if (mas[i]<a) and (mas[i]>mas[i+1])
 then b:=mas[i]
 else b:=mas[i+1];
 if (mas[i]<b) and (mas[i]>mas[i+1])
 then c:=mas[i]
 else c:=mas[i+1];
 end;
 writeln(a,b,c);
end.










































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































