func readFourInts(separator: String.Element = " ") -> (a: Int, b: Int, c: Int, d: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1], c: ints[2], d: ints[3])
}

func mainB() {
    let (a, b, c, d) = readFourInts()
    let results = [a * c, a * d, b * c, b * d]

    print(results.max()!)
}
mainB()