function Main(input) {
	input = input.split(' ').map(e=>Number(e))
  	let list1 = []
    let list2 = []
    let result = []
    
    if(input[2]<0){}
    for(let i = input[0];i<=input[1];i++){
    	for(let j = input[2];j<=input[3];j++){
          	let product = i*j
    		if(i===input[0]){result = product}
          	if(product > result){result = product}
    	}
    }
  console.log(result)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));