let () =
  Scanf.scanf "%d %d %d %d\n" @@ fun a b c d ->
  Printf.printf "%d\n"
    (if a < 0 && c < 0 then
       if b > 0 && d > 0 then max (a*c) (b*d)
       else a*c
     else if a > 0 && c > 0 || b > 0 && d > 0 then b*d
     else if a <= 0 && 0 <= b || c <= 0 && 0 <= d then 0
     else max (a*d) (b*c))