Problem:
 Score : 200 points    Problem Statement Given are integers a,b,c and d .
If x and y are integers and a \leq x \leq b and c\leq y \leq d hold, what is the maximum possible value of x \times y ?      Constraints  -10^9 \leq a \leq b \leq 10^9  -10^9 \leq c \leq d \leq 10^9  All values in input are integers.         Input Input is given from Standard Input in the following format:  a  b  c  d       Output Print the answer.        Sample Input 1 1 2 1 1      Sample Output 1 2  If x = 1 and y = 1 then x \times y = 1 .
If x = 2 and y = 1 then x \times y = 2 .
Therefore, the answer is 2 .       Sample Input 2 3 5 -4 -2      Sample Output 2 -6  The answer can be negative.       Sample Input 3 -1000000000 0 -1000000000 0      Sample Output 3 1000000000000000000

Solution (Python):


import re
import math
from collections import defaultdict,deque,Counter
from fractions import Fraction
import bisect
import itertools
from itertools import accumulate
from copy import deepcopy

import heapq
import random
import time
import os
import sys
from functools import lru_cache,reduce
readline=sys.stdin.readline
sys.setrecursionlimit(100000)
alp="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Set():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(bool)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        if not self.find(x):
            heapq.heappush(self.heap,x)
            self.dic[x]=True
            self.size+=1

    def remove(self,x):
        if self.find(x):
            self.dic[x]=False
            self.size-=1

    def find(self,x):
        return self.dic[x]
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==False:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class multiset():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(int)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        heapq.heappush(self.heap,x)
        self.dic[x]+=1
        self.size+=1

    def remove(self,x):
        if self.dic[x]>0:
            self.dic[x]-=1
            self.size-=1
    
    def count(self,x):
        return self.dic[x]

    def find(self,x):
        return self.dic[x]>0
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==0:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class Point():
    def __init__(self,y,x):
        self.x=x
        self.y=y
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):print("yes" if b else "no")
def Yn(b):print("Yes" if b else "No")
def YN(b):print("YES" if b else "NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(b,t,f):return t if b else f
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def inputintlist(row=1): 
    if row==1:
        ret=list(map(int,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=int(input())
    return ret
def inputfloatlist(row=1): 
    if row==1:
        ret=list(map(float,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=float(input())
    return ret
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    from queue import PriorityQueue
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def getmd(x1,y1,x2,y2):return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow
def zipsort(*args):
    ziplist=sorted(zip(*args))
    for a in range(len(args)):
        for b in range(len(ziplist)):
            args[a][b]=ziplist[b][a]
def zipreverse(*args):
    ziplist=list(zip(*args))
    rev=[]
    for a in range(len(ziplist)-1,-1,-1):
        rev.append(ziplist[a])
    for a in range(len(args)):
        for b in range(len(rev)):
            args[a][b]=rev[b][a]

def to10(A):
    ret=0
    for a in range(len(A)-1,-1,-1):
        ret+=X[a]*2**(N-1-a)
    return ret

a,b,c,d=inputintlist()
ans=max(max(b*d,a*c),max(a*d,b*c))
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())

ans = max(a * c, a * d, b * c, b * d)

print(ans)

Solution (Python):
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
l = []
l.append(a*c)
l.append(a*d)
l.append(b*c)
l.append(b*d)

print(max(l))

Solution (Python):


a, b, c, d = list(map(int, input().split()))

ans = [a*d, a*c, b*c, b*d]

print(max(ans))

Solution (Python):













a,b,c,d=map(int, input().split())


ans_list = []
ans_list.append(a*c)
ans_list.append(a*d)
ans_list.append(b*c)
ans_list.append(b*d)

ans = max(ans_list)

print(ans)

Solution (Python):
a, b,c,d = map(int, input().split())
e = a*c
f = b*d
g = a*d
h = b*c
print(max(e,f,g,h))

Solution (Python):
a,b,c,d=map(int,input().split())
e=a*c
f=a*d
g=b*c
h=b*d
print(max(e,f,g,h))

Solution (Python):
a, b, c, d =map(int, input().split())

print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(max(a*c,a*d),max(b*c,b*d)))

Solution (Python):
a, b, c, d = map(int, input().split())

ans = max(a*c,a*d, b*c, b*d)

print(ans)

Solution (Python):
"""
                            pppppppppppppppppppp
                         ppppp  ppppppppppppppppppp
                      ppppppp    ppppppppppppppppppppp
                      pppppppp  pppppppppppppppppppppp
                      pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
       ppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppp
      pppppppppppppppppppppppppppppppppppppppppppppppp  ppppppppppppppppppppp
     ppppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppppp
    ppppppppppppppppppppppppppppppppppppppppppppppp    pppppppppppppppppppppppp
   pppppppppppppppppppppppppppppppppppppppppppppp     pppppppppppppppppppppppppp
  ppppppppppppppppppppppppppppppppppppppppppppp      pppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppppppp               pppppppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppp     pppppppppppppppppppppppppppppppppppppppppppppp
  ppppppppppppppppppppppppppp    pppppppppppppppppppppppppppppppppppppppppppppppp
    pppppppppppppppppppppppp  pppppppppppppppppppppppppppppppppppppppppppppppppp
     ppppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppppp
      pppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppp
       ppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
                              pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppp  pppppppp
                              ppppppppppppppppppppp    ppppppp
                                 ppppppppppppppppppp  ppppp
                                    pppppppppppppppppppp
"""


import sys
from functools import lru_cache, cmp_to_key
from collections import defaultdict as dd, deque, Counter as C
from bisect import bisect_left as bl, bisect_right as br, bisect
from heapq import heapify, heappop, heappush
from math import ceil, log, floor, sqrt
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var, end="\n"): sys.stdout.write(str(var)+end)
def outa(*var, end="\n"): sys.stdout.write(' '.join(map(str, var)) + end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


a, b, c, d = sp()
answer = max(a * c, b * d, b * c,  d * a)
if a <= 0 <= b or c <= 0 <= d:
    answer = max(answer, 0)
print(answer)

Solution (Python):
a, b, c, d = map(int, input().split())
ans = max(a * c, b * c, a * d, b * d)
print(ans)

Solution (Python):


a, b, c, d = map(int, input().split())

print(max(a * c, a * d, b * c, b * d))

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:input()

"""========main code==============="""


t=1
for _ in range(t):
    a,b,c,d=ml()
    print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
list = [a*c, a*d, b*c, b*d]
print(max(list))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))

Solution (Python):
a,b,c,d = map(int, input().split())
ans = max(a*c, b*d)
ans = max(ans, a*d)
ans = max(ans, b*c)
print(ans)

Solution (Python):


import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    a, b, c, d = iim()

    print(max(a*c, a*d, b*c, b*d))

if __name__ == "__main__":
    resolve()

Solution (Python):
a,b,c,d=map(int,input().split())

c1=a*c
c2=a*d
c3=b*c
c4=b*d

ans=max(c1,c2,c3,c4)
print(ans)

Solution (Python):
dd=input("").split(" ")
a=int(dd[0])
b=int(dd[1])
c=int(dd[2])
d=int(dd[3])
s=max(a*c,b*c,a*d,b*d)
print(s)

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):


import sys
readline = sys.stdin.readline
read = sys.stdin.read

a,b,c,d = map(int,read().split())
print(max(b*d,a*c,a*d,b*c))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a * c, a * d, b * c, b * d))

Solution (Python):
a,b,c,d = map(int,input().split())

print(max(a*c,b*d,b*c,a*d))

Solution (Python):
a, b, c, d = map(int, input().split())

print(max(a*c, a*d, b*c, b*d))

Solution (Python):
a, b, c, d = map(int, input().split())

a1 = a * d
a2 = a * c
a3 = b * c
a4 = b * d

print(max(a1, a2, a3, a4))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a,b,c,d=map(int,input().split())
ans = -10000000000000000000
ans = max( ans, a*c)
ans = max( ans, a*d)
ans = max( ans, b*c)
ans = max( ans, b*d)
print(ans)

Solution (Python):
a,b,c,d = map(int,input().split())

ans = -float('inf')

ans = max(a*c,ans)
ans = max(a*d,ans)
ans = max(b*c,ans)
ans = max(b*d,ans)

print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())

print(max([a*c, a*d, b*c, b*d]))

Solution (Python):
import numpy as np

abcd=np.array(input().split(" "),dtype=np.int64)
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]

can=[a*c,a*d,b*c,b*d]

print(max(can))

Solution (Python):
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
import copy


MOD = 10 ** 9 + 7



a, b, c, d = map(int, input().split())
ans = max(a*c, a*d, b*c, b*d)
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())

print(max(a*c, b*c, a*d, b*d))

Solution (Python):
a, b, c, d = map(int, input().split())

ans = max(a*c, a*d, b*c, b*d)
print(ans)

Solution (Python):
a,b,c,d= map(int, input().split())

ans=max(a*c,a*d,b*c,b*d)
print(ans)

Solution (Python):
a,b,c,d=map(int,input().split())

ans=[a*c,a*d,b*c,b*d]
if a*b>0 and c*d>0:
    print(max(ans))
else:
    print(max(0,max(ans)))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
from sys import stdin
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]


a,b,c,d = ip()

ans = max(a*c, a*d, b*c, b*d)
print(ans)

Solution (Python):
a, b, c, d = map(int,input().split())

ans = [a*c, a*d, b*c, d*b]

print(max(ans))

Solution (Python):
a, b, c, d = map(int, input().split())
res = float('-inf')
lst = [a, b]
lst1 = [c, d]
for i in lst:
    for j in lst1:
        res = max(res, i*j)
print(res)

Solution (Python):

import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi


def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

def lcm(a, b): return a * b // gcd(a, b)


def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y


for _ in range(int(input()) if not True else 1):
    
    
    a, b, c, d = map(int, input().split())
    
    
    
    
    print(max(b*c, b*d, a*c, a*d))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
from itertools import product


a, b, c, d = map(int, input().split())

ans = -float("inf")
for x, y in product([a, b], [c, d]):
    ans = max(ans, x * y)
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))

Solution (Python):
def main():
    a, b, c, d = map(int, input().split())
    ans = -float('inf')
    for x in [a, b]:
        for y in [c, d]:
            ans = max(ans, x * y)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

    a,b,c,d = map(int,input().split())


    ans = max(a*c,a*d,b*c,b*d)

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
a, b, c, d = map(int, input().split())

ac = a * c
ad = a * d
bc = b * c
bd = b * d

print(max([ac, ad, bc, bd]))

Solution (Python):
a, b, c, d = map(int, input().split())
ans = max([a*c, a*d, b*c, b*d])
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())

ans = 0


A = a*c
B = a*d
C = b*c
D = b*d 
ans = max(A,B)
ans = max(ans,C)
ans = max(ans,D)
print(ans)

Solution (Python):
a,b,c,d=map(int,input().split())
e=[a*c,a*d,b*c,b*d]
print(max(e))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):

a, b, c, d = map(int, input().split())
results = [a*c, a*d, b*c, b*d]
print(max(results))

Solution (Python):
a, b, c, d = map(int, input().split())

ans = max([a * c, a * d, b * c, b * d])
print(ans)

Solution (Python):
import sys
import math
import collections
import bisect
import itertools
import decimal
import copy
import heapq




INF = 10 ** 20
MOD = 10 ** 9 + 7


ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))
flush = lambda: sys.stdout.flush()



def main():
    a, b, c, d = ns()
    ans = 0 if a <= 0 <= b or c <= 0 <= d else -INF

    x = [a, b]
    y = [c, d]
    for xi in x:
        for yi in y:
            tmp = xi * yi
            ans = max(ans, tmp)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')


from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations




def solve():
    a, b, c, d = MI()
    ans = -INF
    ans = max(ans, a*c)
    ans = max(ans, a*d)
    ans = max(ans, b*c)
    ans = max(ans, b*d)
    print(ans)


if __name__ == '__main__':
    solve()

Solution (Python):
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())

li = [(a, c), (a, d), (b, c), (b, d)]

INF = 1 << 60
ans = -INF
for x, y in li:
    ans = max(ans, x * y)

print(ans)

Solution (Python):
a, b, c, d = [int(x) for x in input().split()]
print(max([a * c, b * c, b * d, a * d]))

Solution (Python):
a, b, c, d= map(int,input().split())
print(max(a * c, a * d, b * c, b * d))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max([a*c, a*d, b*c, b*d]))

Solution (Python):
'''بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'''

gi = lambda : list(map(int,input().split()))
a, b, c, d = gi()
print(max(a * c, a * d, b * c, b * d))

Solution (Python):








def solve(a, b, c, d):
    print(max(a * c, a * d, b * c, b * d))


if __name__ == '__main__':
    
    
    a, b, c, d = map(int, input().split())
    
    
    
    solve(a, b, c, d)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

a, b, c, d = na()
kouho = [a * c, a * d, b * c, b * d]
print(max(kouho))

Solution (Python):
a, b, c, d = map(int, input().split())
ans = max(a * c, b * d, a * d, b * c)
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())
print(max([a*c, a*d, b*c, b*d]))

Solution (Python):
def main():
    a, b, c, d = list(map(int, input().split()))
    ans = max([a*c, a*d, b*c, b*d])
    if a <= 0 <= b or c <= 0 <= d:
        ans = max(ans, 0)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def solve(a, b, c, d):
    return max([a * c, a * d, b * c, b * d])


def main():
    a, b, c, d = map(int, input().split())
    res = solve(a, b, c, d)
    print(res)


def test():
    assert solve(1, 2, 1, 1) == 2
    assert solve(3, 5, -4, -2) == -6
    assert solve(-1000000000, 0, -1000000000, 0) == 1000000000000000000


if __name__ == "__main__":
    test()
    main()

Solution (Python):
a,b,c,d = map(int,input().split())
print(max(a*c, b*d, a*d, b*c))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split(' '))

print(max(a*c, a*d, b*c, b*d))

Solution (Python):
a,b,c,d = map(int,input().split())
c1 = [a,b]
c2 = [c,d]
if(a <= 0 <= b):
    c1.append(0)
if(c <= 0 <= d):
    c2.append(0)

ans = -1 * 10**20
for x in c1:
    for y in c2:
        ans = max(ans,x*y)
print(ans)

Solution (Python):
a,b,c,d = list(map(int, input().split()))

print(max(a*c, a*d, b*c, b*d))

Solution (Python):
import sys
input = sys.stdin.readline


def read():
    a, b, c, d = map(int, input().strip().split())
    return a, b, c, d


def solve(a, b, c, d):
    ans = [a * c, a * d, b * c, b * d]
    if a * b < 0 or c * d < 0:
        ans.append(0)
    return max(ans)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Solution (Python):
a, b, c, d = map(int, input().split())
result = max(a*c, a*d, b*c, b*d)
print(result)

Solution (Python):
from sys import stdin, stdout
import math
inp = lambda : stdin.readline().strip()
 
a, b, c, d = [int(x) for x in inp().split()]
print(max(a * c, a*d, b*c, b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))

Solution (Python):
import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
a,b,c,d = MI()
m = max(a*c,a*d,b*c,b*d)
print(m)

Solution (Python):
a, b, c, d = list(map(int, input().split()))

ans = a * c
ans = max(ans, b*d)
ans = max(ans, a*d)
ans = max(ans, b*c)
print(ans)

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a,b,c,d=map(int,input().split())
L=[]
if a*b<=0 or c*d<=0:
    L.append(0)
L.append(a*c)
L.append(a*d)
L.append(b*c)
L.append(b*d)
print(max(L))

Solution (Python):
a, b, c, d = list(map(int, input().split()))

print(max(a*c, b*d, a*d, b*c))

Solution (Python):
from sys import stdin
inp = lambda : stdin.readline().strip()

a,b,c,d = [int(x) for x in inp().split()]

print(max(a*c,b*d,a*d,b*c))

Solution (Python):
a,b,c,d = list(map(int, input().split()))
print(max(a*c, b*d, a*d, b*c))

Solution (Python):
a, b, c, d = map(int, input().split())

print(max(
    a*c,
    a*d,
    b*c,
    b*d))

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())

x1 = a*c
x2 = a*d
x3 = b*c
x4 = b*d

ans = max(x1,x2,x3,x4)
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    A, B, C, D = [int(x) for x in input().split()]
    ans = -float("inf")
    if A <= 0 <= B or C <= 0 <= D:
        ans = 0

    ans = max(ans, B * D)
    ans = max(ans, B * C)
    ans = max(ans, A * D)
    ans = max(ans, A * C)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import math
import re


a,b,c,d=map(int,input().split())

print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
x = b*d
y = a*d
z = a*c
w = b*c

print(max(x, y, z, w))

Solution (Python):
a, b, c, d = map(int, input().split())

ans = max(a * c, a * d, b * c, b * d)
print(ans)

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
ans = -1000000000000000000
ans = max(ans, a * c, a * d, b * c, b * d)
print(ans)

Solution (Python):
import math
import fractions
import collections
import itertools
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a,b,c,d = map(int,input().split())

print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
ans = max(a*c, a*d, b*c, b*d)
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())
print(max(a*c,a*d,b*c,b*d))

Solution (Python):
a, b, c, d = map(int, input().split())
print(max([a*c,a*d,b*c,b*d]))

Solution (Python):
a,b,c,d = list(map(int, input().split()))
l = []
l.append(a*c)
l.append(a*d)
l.append(b*c)
l.append(b*d)
print(max(l))

Solution (Python):


import sys

class BProductMax:
    def solve(self, tc=0):
        a, b, c, d = [int(_) for _ in input().split()]
        ans = max(b * d, a * c, a * d, b * c)
        print(ans)


solver = BProductMax()
input = sys.stdin.readline

solver.solve()

Solution (Python):
a,b,c,d=map(int,input().split())
print(max(b*d,a*c,a*d,b*c))

Solution (Python):
a, b, c, d = map(int, input().split())
ans = max(a * c, a * d, b * c, b * d)
print(ans)

Solution (Python):
a, b, c, d = list(map(int, input().split()))
print(max(max(a*c, a*d), max(b*c, b*d)))

Solution (Python):
a,b,c,d=map(int,input().split())
l1=a*c
l2=a*d
l3=b*c
l4=b*d
print(max(l1,l2,l3,l4))

Solution (Python):

import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    a, b, c, d = MI()
    ans = -1 * 10 ** 19

    for A in [a, b]:
        for B in [c, d]:
            ans = max(ans, A * B)

    print(ans)


main()

Solution (Python):
a, b, c, d = map(int, input().split())

ans = max(a*c, a*d, b*c, b*d)

print(ans)

Solution (Python):
a,b,c,d = map(int,input().split())
ans = b * d
for i in a,b:
    for j in c,d:
        ans = max(i*j,ans)
print(ans)

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    a, b, c, d = in_nn()

    ans = max(a * c, a * d, b * c, b * d)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
a, b, c, d = map(int, input().strip().split())

ans = max(a * c, a * d, b * c, b * d)
print(ans)

Solution (Python):
a,b,c,d = list(map(int,input().split()))

x = [a,b]
y = [c,d]
ans = [i * j for i in x for j in y]
print( max(ans) )

Solution (Python):
a,b,c,d=map(int, input().split())

ans = max(a*c,a*d,b*c,b*d)

print(ans)

Solution (Python):
def main():
    a, b, c, d = map(int, input().split())
    ans = a*c
    ans = max(ans, a*d)
    ans = max(ans, b*c)
    ans = max(ans, b*d)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
a,b,c,d = map(int, input().split())

ans = max(a*c,a*d, b*c,b*d)
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())
rst = max(a*c, b*d, b*c, a*d)
print(rst)