'use strict'

function main(input) {
    let a = Number(input.split('\n')[0].split(' ')[0]);
    let b = Number(input.split('\n')[0].split(' ')[1]);
    let c = Number(input.split('\n')[0].split(' ')[2]);
    let d = Number(input.split('\n')[0].split(' ')[3]);

    let ab = a * b;
    let cd = c * d;
    let ab_dai;
    let cd_dai;
    let ans;

    if ((ab < 0 && cd >= 0) || (ab >= 0 && cd < 0) || ((a >= 0 && b >= 0) && (c >= 0 && d >= 0))) {
        ab_dai = a > b ? a : b;
        cd_dai = c > d ? c : d;
    }
    else if ((a < 0 && b < 0) && (c >= 0 && d >= 0)) {
        ab_dai = a > b ? a : b;
        cd_dai = c > d ? d : c;
    }
    else if ((a >= 0 && b >= 0) && (c < 0 && d < 0)) {
        ab_dai = a > b ? b : a;
        cd_dai = c > d ? c : d;
    }
    else {
        ab_dai = a > b ? b : a;
        cd_dai = c > d ? d : c;
    }
    ans = ab_dai * cd_dai;
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));