var n,i,j,e,m,h,k:longint;
a:array[1..50]of longint;
procedure swap(var a,b:longint);
var t:longint;
begin
t:=a; a:=b; b:=t;
end;
function f(x,y,z:longint):longint;
begin
exit(abs(abs(a[y]-a[x])-abs(a[z]-a[y])));
end;
begin
readln(n);
for i:=1 to n do read(a[i]);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then swap(a[i],a[j]);
E:=1; M:=2; H:=n;
for i:=1 to n do
for k:=n downto i+2 do
for j:=i+1 to k-1 do
if f(i,j,k)<f(E,M,H) then begin
E:=i;M:=j;H:=k;
end;
writeln(a[E],' ',a[M],' ',a[H]);
close(input);
close(output);
end.