stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.317683657840428x):
#include<iostream>

#include<algorithm>

#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);

using namespace std;

typedef long long ll;

ll a,b,c,d;



int main()

{

	ios;

	cin>>a>>b>>c>>d;

	ll m1,m2,m3,m4,maxn;

	m1=a*c,m2=a*d;

	m3=b*c,m4=b*d;

	maxn=max(max(max(m1,m2),m3),m4);

	cout<<maxn<<"\n";

	return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.327874396938196x):
#include <stdio.h>

#include <string.h>

#include <iostream>

#define ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;

const int MAXN=1100;

int main()

{

    ios;

    ll a,b,c,d;

    cin>>a>>b>>c>>d;

    ll ans[5];

    ans[1]=a*c;

    ans[2]=a*d;

    ans[3]=b*c;

    ans[4]=b*d;

    ll x=max(ans[1],ans[2]);

    ll y=max(ans[3],ans[4]);

    cout<<max(x,y)<<'\n';

    return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.532100193593307x):
#include <iostream>

#include <cstring> 

#include <cmath>

#include <cstdio>

using namespace std;

int main(){

	long long a,b,c,d,t,n;

	scanf("%lld%lld%lld%lld",&a,&b,&c,&d);

	t=max(a*c,a*d);

	n=max(b*c,b*d); 

		cout<<max(t,n)<<endl;	

	return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.44734363889503x):
#include<iostream>

using namespace std;

long long int a,b,c,d;

long long int max(long long int x,long long int y){

	if(x>y)return x;

	return y;

}

int main(){

	cin>>a>>b>>c>>d;

	cout<<max(a*c,max(a*d,max(b*c,b*d)))<<endl;

	return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.448087815106293x):
#include<iostream>



using namespace std;



int main() {

	long long a,b,c,d;

	cin >> a >> b >> c >> d;

//	cout << a*c << endl;

	cout << (long long)max(max(a*c,a*d),max(b*c,b*d)) << endl;

	return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.451328216726568x):
#include<iostream>

#include<algorithm>

typedef long long ll;



using namespace std;



ll a, b, c, d;

ll a1[4];



int main() {

	cin >> a >> b >> c >> d;

	a1[0] = a * c; a1[1] = a * d; a1[2] = b * c; a1[3] = b * d;

	sort(a1, a1 + 4);

	cout << a1[3] << '\n';

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.446689979870518x):
#include<stdio.h>

#include<iostream>

#include<algorithm> 

using namespace std;

typedef long long ll;



int main(){

	ll s1[10];

	for(int i=1;i<=4;i++)	cin>>s1[i];

	ll s=s1[1]*s1[3];

	for(int i=1;i<=2;i++){

		for(int j=3;j<=4;j++){

			s=max(s,s1[i]*s1[j]);

		} 

	}

	cout<<s<<endl;

	return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.328312902502816x):
#include<bits/stdc++.h>

#define endl '\n'

#define F first

#define S second

#define PB push_back

#define MP make_pair

#define mod 1000000007

#define FASTIO ios::sync_with_stdio(0); cin.tie(0);

#define REP(i,a,b) for(int i=a;i<b;i++)

#define maxx 1000001

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pi;



int main() {

    FASTIO

    ll a,b,c,d,d1,d2,d3,d4;

    cin>>a>>b>>c>>d;

    d1=a*c;d2=a*d;d3=b*c;d4=b*d;

    cout<<max({d1,d2,d3,d4})<<endl;

    return 0;

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.115276724048053x):
#include "bits/stdc++.h"



using namespace std;

#define ll long long

#define ull unsigned long long

#define pb push_back

#define lin "\n"

#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(0)



void solve() {

    long double a, b, c, d;

    cin >> a >> b >> c >> d;

    cout.precision(0);

    cout << fixed << max(a * c, max(a * d, max(b * c, b * d))) << lin;

}



int main() {

    fast_io;

    int t = 1;

//    cin >> t;

//    scanf("%d",&t);

    int c = 1;

    while (t--) {

//        printf("Case %lld: ",c);

//        cout<<"Case "<<c<<": ";

        solve();

        c++;

    }

}
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.326034092261326x):
///*/////////////////////////////*///

/// IN THE NAME OF ALMIGHTY ALLAH ///

///*/////////////////////////////*///



///*////////////////////*///

/// Author : SAIFULLAH29 ///

///*////////////////////*///



///*//////////////////////////////////////////*///

/// "When you want something, all the universe ///

///  conspires in helping you to achieve it."  ///

///              - Paulo Coelho, The Alchemist ///

///*//////////////////////////////////////////*///



#include <bits/stdc++.h>



#define SS           " "

#define endl         "\n"

#define EPS          1e-9

#define gcd          __gcd

#define pb           push_back

#define pi           acos(-1.0)

#define Ars          greater<int>()

#define vi           vector<int>

#define vvi          vector<vector<int> >

#define flush        cin.ignore(numeric_limits<streamsize>::max(),'\n');

#define wow          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);



using namespace std;



typedef long long              ll;

typedef double                 dbl;

typedef unsigned long long     ull;



void solve()

{

    ll a, b, c, d, x, y;

    cin>>a>>b>>c>>d;

    x = max(a*c, b*c);

    y = max(a*d, b*d);

    cout<<max(x, y)<<endl;

}



int main()

{

    wow



    int t=1;

    //cin>>t;



    while(t--)

        solve();



    return 0;

}



///*////////////////////////////////////////////*///

/// "There is only one thing that makes a dream  ///

/// impossible to achieve: the fear of failure." ///

///                - Paulo Coelho, The Alchemist ///

///*////////////////////////////////////////////*///
// Slower C++ solution:
//Mahir Ratanpara (DA-IICT)

#include<bits/stdc++.h>

using namespace std;

#define Ff(i,a,n) for(i=a;i<n;i++)

#define Fr(i,a,n) for(i=a;i>n;i--)

#define ll long long

#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define clr(x) memset(x, 0, sizeof(x))

#define sortall(x) sort(all(x))

#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)

typedef pair<ll, ll>	pa;

typedef vector<ll>		vc;

typedef vector<pa>		vp;

typedef vector<vc>		vvc;

int mpow(int base, int exp); 

void ipgraph(ll n,ll m);

void dfs(int u, int par);

const int mod = 1000000007;

const int N = 3e5, M = N;

//=======================



vc g[N];



int main() {

    FAST;

    ll t, i, l,j, k, p, q, r, x, y, u, v, n, m;

    n=4;

    vc a(n);

    Ff(i,0,n)

    cin>>a[i];



    ll maxi=-1e18;

    Ff(i,0,2)

    {

      Ff(j,2,n)

      {

        maxi=max(maxi,a[i]*a[j]);

      }

    }

    cout<<maxi<<"\n";

    return 0;

}



int mpow(int base, int exp) {

  base %= mod;

  int result = 1;

  while (exp > 0) {

    if (exp & 1) result = ((ll)result * base) % mod;

    base = ((ll)base * base) % mod;

    exp >>= 1;

  }

  return result;

}



void ipgraph(ll n, ll m){

	int i, u, v;

	while(m--){

		cin>>u>>v;

		g[u-1].pb(v-1);

		g[v-1].pb(u-1);

	}

}



void dfs(int u, int par){

	for(int v:g[u]){

		if (v == par) continue;

		dfs(v, u);

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.566013739376222x):
#include "bits/stdc++.h"

using namespace std;

#define ll long long int

#define MUL(A,B,C)	(max(A*C, B*C))

int main(){

	ll a[4];

	for(int i=0; i<4; i++)  scanf("%lld", &a[i]);

	printf("%lld\n", max(MUL(a[0],a[1],a[2]), MUL(a[0],a[1],a[3])));

}