Var
x, y, z, d: real;
function min(a, b: real): real;
begin
if a < b then
min := a
else min := b;
end;
function max(a, b: real): real;
begin
if a > b then
max := a
else max := b;
end;
begin
readln(x, y, z, d);
writeln(max(min(x, y), max(min(x, z), min(z, d))));
end.