var
x, y, z, p : real;
function max (a, b : real) : real;
begin
if a > b then max := a else max := b;
end;
function min (a, b : real) : real;
begin
if a < b then min := a else min := b;
end;
begin
read (x, y, z);
if z < 0 then p := max (x, y) else p := min (x, y);
write (p);
end.