#include <fstream>

using namespace std;

int main()
{
    int a,b,c,d;
    ifstream fin("stdin");
    fin>>a>>b>>c>>d;
    fin.close();
    int max=a*b+c*d;
    int v=a*c+b*d;
    if(v>max)
        max=v;
    v=a*d+b*c;
    if(v>max)
        max=v;
    ofstream fout("stdout");
    fout<<max;
    fout.close();
    return 0;
}