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 sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """1 2 1 1"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3 5 -4 -2"""
        output = """-6"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """-1000000000 0 -1000000000 0"""
        output = """1000000000000000000"""
        self.assertIO(input, output)


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

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


if __name__ == "__main__":
    
    resolve()

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

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

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

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

x = [a,b]
y = [c,d]

ans = -100100100100100100100
for i in x:
    for j in y:
        ans = max(ans, i*j)
        
print(ans)

Solution (Python):

a, b, c, d = map(int,input().split())
kot = []
kot.append(a * c)
kot.append(a * d)
kot.append(b * c)
kot.append(b * d)
kot = sorted(kot,reverse=True)
print(kot[0])

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

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

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

print(max(ans_lis))

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

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

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

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

ans = max(ac , ad)
ans = max(ans, bd)
ans = max(ans, bc)

print(ans)

Solution (Python):
a,b,c,d=map(int, input().split())
ans=-10**20
ans=max(a*c,ans)
ans=max(a*d,ans)
ans=max(b*c,ans)
ans=max(b*d,ans)
if a<=0<=b or c<=0<=d: ans=max(0,ans)
print(ans)

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

ma=-10000000000000000000000000000000
for i in range(4):
    if ma<k[i]:
        ma=k[i]

print(ma)

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

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())

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

L.sort(reverse = True)
print(L[0])

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

Solution (Python):
a, b, c, d = map(int, input().split())
if a*c > a*d:
    a1 = a*c
else:
    a1 = a*d
if b*c > b*d:
    a2 = b*c
else:
    a2 = b*d
if a1 > a2:
    print(a1)
else:
    print(a2)

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    a, b, c, d = map(int, input().split())
    ans = 0
    o = a*c
    p = a*d
    q = b*c
    r = b*d
    ans = max(o, p,q, r)
    print(ans)

        



if __name__ == '__main__':
    main()

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

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

print(max(x))

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())
rep = []
rep.append(a*c)
rep.append(b*c)
rep.append(a*d)
rep.append(b*d)
print(max(rep))

Solution (Python):
a,b,c,d = map(int, input().split())
t = list()
ac = a*c
bc = b*c
ad = a*d
bd = b*d
t.append(ac)
t.append(bc)
t.append(ad)
t.append(bd)
ans = -1 * 10**18
for i in range(4):
  ans = max(t[i],ans)
print(ans)

Solution (Python):

a, b, c, d = map(int,input().split())
tmp = a*c
if tmp < a*d:
  tmp = a*d
if tmp < b*c:
  tmp = b*c
if tmp < b*d:
  tmp = b*d
print(tmp)

Solution (Python):
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)
a,b,c,d=map(int, input().split())

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

Solution (Python):

import math

A,B,C,D = map(int,input().split())

ans = [A*C, A*D, B*C, B*D]
print( max(ans) )

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

AC = a * c
AD = a * d
BC = b * c
BD = b * d

if AC > AD and AC > BC and AC > BD:
    print(AC)
elif AD > BC and AD > BD:
    print(AD)
elif BC > BD:
    print(BC)
else:
    print(BD)

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())

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

print(max(cand))

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

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

print(max(ans))

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

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

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):
a,b,c,d=map(int,input().split())

if a<0 and b>0:
    ans=max(a*c,a*d,b*c,b*d,0)
elif c<0 and d>0:
    ans=max(a*c,a*d,b*c,b*d,0)
else:
    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 = list()
l.append(a * c)
l.append(a * d)
l.append(b * c)
l.append(b * d)

print(max(l))

Solution (Python):
def main():

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

    ans = a * c
    ans2 = a * d
    ans3 = b * c
    ans4 = b * d
    
    if ans2 > ans:
        ans = ans2
    
    if ans3 > ans:
        ans = ans3

    if ans4 > ans:
        ans = ans4

    print(ans)

main()

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

lst.append(a*c)
lst.append(a*d)
lst.append(b*c)
lst.append(b*d)

print(max(lst))

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

Solution (Python):
a,b,c,d=map(int,input().split())
if a>=0 and c>=0:
  print(b*d)
elif a<0 and c>=0:
  if b>=0:
    print(b*d)
  else:
    print(b*c)

elif c<0 and a>=0:
  if d>=0:
    print(b*d)
  else:
    print(d*a)    
else:
  if b<0 or d<0:
    print(a*c)
  else:
    if a*c<=b*d:
      print(b*d)
    else:
      print(a*c)

Solution (Python):
def main():
    a,b,c,d = map(int,input().split())
    
    ans = -1 * 10**20
    
    if a*b <= 0:
        ans = 0
    if c*d <= 0:
        ans = 0
    
    for i in (a,b):
        for j in (c,d):
            if i*j > ans:
                ans = i*j
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
a,b,c,d=map(int,input().split())
ans=max(a*c,a*d)
ans=max(ans,b*c)
ans=max(ans,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())
result = -1000000000000000000
ac = a * c
if result < ac:
    result = ac
ad = a * d
if result < ad:
    result = ad
bc = b * c
if result < bc:
    result = bc
bd = b * d
if result < bd:
    result = bd
print(result)

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 = list(map(int, input().split()))

ans = []

ans.append(a*c)
ans.append(a*d)
ans.append(b*c)
ans.append(b*d)

ans.append(c*a)
ans.append(c*b)
ans.append(d*a)
ans.append(d*b)

print(max(ans))

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

ab = a*c
ad = a*d
bc = b*c
bd = b*d
print(max(ab,ad,bc,bd))

Solution (Python):
a,b,c,d = map(int,input().split())
a1 = []
e = [a,b]
f = [c,d]
for i in e:
    for j in f:
        a1.append(i*j)
print(max(a1))

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

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

Solution (Python):
a, b, c, d = [int(i) for i in input().split()]
print(max([a * d, a * c, 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,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 = list(map(int, input().split()))
print(max(a * c, a * d, b * c, b * d))

Solution (Python):
myinput = list(map(int,input().split()))

firstarg = myinput[0:2]
secondarg = myinput[2:4]



resultlist = [0]*4

for i in range(2):
    for j in range(2):
        resultlist[2*i+j]=firstarg[i]*secondarg[j]


print(max(resultlist))

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

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

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

print(ans)

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

Solution (Python):
n = [int(i) for i in input().split(' ')]
a = n[0]
b = n[1]
c = n[2]
d = n[3]
ans_list = []
ans_list.append(a*c)
ans_list.append(a*d)
ans_list.append(b*c)
ans_list.append(b*d)
print(max(ans_list))

Solution (Python):

import sys


def solve(a: int, b: int, c: int, d: int):
    ans1=a*c
    ans2=a*d
    ans3=b*c
    ans4=b*d
    print(max(ans1,ans2,ans3,ans4))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  
    b = int(next(tokens))  
    c = int(next(tokens))  
    d = int(next(tokens))  
    solve(a, b, c, d)

if __name__ == '__main__':
    main()

Solution (Python):
lis = list(map(int,input().split()))

ans_num = -10000000000000000001

if lis[0] * lis[2] >= ans_num:
    ans_num = lis[0] * lis[2]
if lis[0] * lis[3] >= ans_num:
    ans_num = lis[0] * lis[3]
if lis[1] * lis[2] >= ans_num:
    ans_num = lis[1] * lis[2]
if lis[1] * lis[3] >= ans_num:
    ans_num = lis[1] * lis[3]

print(ans_num)

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())
if a == 0 and a!=b:
    a += 1
if b == 0 and a!=b:
    b -= 1
if c == 0 and c!=d:
    c += 1
if d == 0 and c!=d:
    d -= 1
num1 = a*c
num2 = a*d
num3 = b*c
num4 = b*d
print(max(num1,num2,num3,num4))

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())
cand = [a*c,a*d,b*c,b*d]
ans = max(cand)
print(ans)

Solution (Python):
a, b, c, d = list(map(int, input().split()))
max = a * c
for i, j in ((a, d), (b, c), (b, d)):
    p = i * j
    if p > max:
        max = p

print(max)

Solution (Python):








    






mod = int(1e9+7)

INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def main():
    a,b,c,d = readInt()
    ans = a * c
    ans = max(ans,b * c)
    ans = max(ans,a * d)
    ans = max(ans,b * d)
    print(ans)
    return

if __name__=='__main__':
    main()

Solution (Python):
a,b,c,d = map(int,input().split())
if b < 0:
    if c >= 0:
        ans = b*c
    else:
        ans = a*c
elif a > 0:
    if d < 0:
        ans = a*d
    else:
        ans = b*d
else:
    ans = max(a*c,b*d)
print(ans)

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

Solution (Python):


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

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

print(max(l))

Solution (Python):
def main():
    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())
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):

import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)

def main():
    a, b, c, d = 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):
n = list(map(int,input().split()))

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

x = max(a,b,c,d)

print(x)

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

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

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

x_list = [a, b]
y_list = [c, d]

ans_list = []
for x in x_list:
    for y in y_list:
        ans = x*y
        ans_list.append(ans)

ans_list.sort()
ans = ans_list[-1]
print(ans)

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

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


print(max(M))

Solution (Python):
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)

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

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

Solution (Python):
x = list(map(int, input().split()))
print(max([x[0]*x[2],x[0]*x[3],x[1]*x[2],x[1]*x[3]]))

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

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

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

print(max(candidate))

Solution (Python):
a,b,c,d = map(int, input().split())
li = []
i = 0
ac = a*c
ad = a*d
bc = b*c
bd = b*d

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

Solution (Python):
a=list(map(int,input().split()))
kazutachi=[]
kazutachi.append(a[0]*a[2])
kazutachi.append(a[0]*a[3])
kazutachi.append(a[1]*a[2])
kazutachi.append(a[1]*a[3])
print(max(kazutachi))

Solution (Python):
a,b,c,d = map(int, input().split())
ans = max(a*c, a*d, b*c, b*d)
if ans<0 and (a<=0 and b>=0 or c<=0 and d>=0):
    ans = 0
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())
max = -10000000000000000000000
if max < a*c:
  max = a*c
if max < a*d:
  max = a*d
if max < b*c:
  max = b*c
if max < b*d:
  max = b*d
  
print(max)

Solution (Python):
a,b,c,d = list(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()))
print(max(a * c, b * d, 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 = map(int,input().split())

ans1 = a*c
ans2 = a*d
ans3 = b*c
ans4 = b*d
print(max(ans1,ans2,ans3,ans4))

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())
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())

ans1 = a*c
ans2 = a*d
ans3 = b*c
ans4 = b*d

print(max(ans1,ans2,ans3,ans4))

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

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

if __name__=="__main__":
    solve()

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

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

Solution (Python):
a, b, c, d = list(map(int, input().split(" ")))
r = []
for i in [a, b]:
  for j in [c, d]:
    r.append(i * j)

print(max(r))

Solution (Python):
a,b,c,d = list(map(int, input().split()))
         
A = a * c
B = a * d
C = b * c
D = b * d

print(max(A,B,C,D))

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

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

x = [ac,ad,bc,bd]
x.sort()

print(x[3])

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

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

Solution (Python):
A,B,C,D = map(int,input().split())

a = A * C
b = A * D
c = B * C
d = B * D

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

Solution (Python):
a, b, c, d = (int(i) for i in 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()))

_max = -float("inf")
for i in [a, b]:
    for j in [c, d]:
        if _max < i * j:
            _max = i * j
print(_max)

Solution (Python):
a,b,c,d = map(int,input().split())
ac = a*c
ad = a*d
bc = b*c
bd = b*d

if ac>ad and ac>bc and ac>bd:
  print(ac)
elif ad >bc and ad>bd and ad>ac:
  print(ad)
elif bc>ac and bc>ad and bc>bd:
  print(bc)
else:
  print(bd)

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
a, b, c, d = [int(x) for x in stdin.readline().rstrip().split()]
A = []
A.append(a * c)
A.append(a * d)
A.append(b * c)
A.append(b * d)
m = max(A)
print(m)

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

from itertools import combinations

a = max(map(lambda x:x, [a*c, b*d, a*d, b*c]))
print(a)

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

Solution (Python):
a, b, c, d = 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)

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())

a_c = a * c
a_d = a * d
b_c = b * c
b_d = b * d

list_ans = [a_c, a_d, b_c , b_d]

print(max(list_ans))

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

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

print(max(ans))

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

anss = []

anss.append(a*c)
anss.append(a*d)
anss.append(b*c)
anss.append(b*d)

print(max(anss))

Solution (Python):
from itertools import combinations
import numpy as np
a,b,c,d =  map(int, input().split())
ans = -np.inf
ans = max(a*d, ans)
ans = max(a*c, 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):
a, b, c, d = map(int, input().split())

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

print(ans)

Solution (Python):
import math

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


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

Solution (Python):
import numpy as np

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

xy1=a*c
xy2=a*d
xy3=b*c
xy4=b*d

xymax=max([xy1,xy2,xy3,xy4])
print (xymax)

Solution (Python):
a,b,c,d=[int(_) for _ in 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())
Z=[a*c,a*d,b*c,b*d]
print(max(Z))

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())

lis = []
lis.append(a * c)
lis.append(a * d)
lis.append(b * c)
lis.append(b * d)
print(max(lis))

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

ans = max(a * c, b * d, a * d, b * c)
if (a <= 0 and b >= 0) or (c <= 0 and d >= 0):
  ans = max(ans, 0)

print(ans)

Solution (Python):
from sys import stdin

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

L = list()

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 = map(int,input().split())

a1 = a*c
a2 = b*d
a3 = c*b
a4 = a*d
ans = max(max(a1,a2),max(a3,a4))
print(ans)

Solution (Python):
a,b,c,d=map(int, input().split())
if (a<=0 and b>=0) or (c<=0 and d>=0):
  print(max(b*d,a*c,a*d,b*c,0))
else:
  print(max(b*d,a*c,a*d,b*c))

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

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

ans = max(ac,ad,bc,bd)

print(ans)

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

Solution (Python):
import sys
import numpy as np
import math
import collections
import copy
import decimal
import itertools
from collections import deque 
from functools import reduce
from itertools import product
from itertools import combinations
 


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

ans = max(a*c, a*d)
ans = max(ans, b*c)
ans = max(ans, 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())

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

print(max(res))

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

main()

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())

A = a*c
B = a*d
C = b*c
D = b*d


print(max([A, B, C, 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, b * c, a * d, b * d))

Solution (Python):
import sys
from sys import stdin,stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache

try:
    for _ in range(1):
        a,b,c,d=map(int,input().split())
        if a>0 and c>0:
            print(b*d)
        else:
            print(max([a*c,a*d,b*c,b*d]))





    
except EOFError as e:
    print(e)

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

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

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

Solution (Python):
A=list(map(int,input().split(' ')))
print(max(A[0]*A[2],A[1]*A[2],A[0]*A[3],A[1]*A[3]))

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

Solution (Python):
i1 = input().split()
print(max([int(i1[0])*int(i1[2]), int(i1[0])*int(i1[3]), int(i1[1])*int(i1[2]), int(i1[1])*int(i1[3])]))

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(int(max(a*c,a*d,b*c,b*d)))

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

a1 = a*c
a2 = a*d

a3 = b*c
a4 = b*d


ans = max(max(a1, a2), max(a3, a4))

print(ans)

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

Solution (Python):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
J=int(1e9)+7


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

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

if a * b < 0:
    x.append(-1)
    x.append(1)
    
if c * d < 0:
    y.append(-1)
    y.append(1)
    
ans = - (10 ** 20)
    
for i in x:
    for j in y:
        ans = max((i*j),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):
a, b, c, d = map(int, input().split())
ans1 = a*c
ans2 = a*d
ans3 = b*c
ans4 = b*d
print(max(ans1, ans2, ans3, ans4))

Solution (Python):


lis = list(map(int, input().split()))

li = []

li.append(lis[0] * lis[2])
li.append(lis[0] * lis[3])
li.append(lis[1] * lis[2])
li.append(lis[1] * lis[3])

print(max(li))

Solution (Python):
a, b, c, d = map(int, input().split())
r = None
for x in (a, b):
    for y in (c, d):
        rr = x * y
        r = rr if r is None else max(r, rr)
print(r)

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

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

Solution (Python):

ls = list(map(int, input().split()))
ans = max([ls[0]*ls[2], ls[0]*ls[3], ls[1]*ls[2], ls[1]*ls[3]])

print(ans)

Solution (Python):
'''
Created on 2020/09/13

@author: okazakieiichiro
'''

a, b, c, d = (int(x) for x in input().split())

ans1 = a * c
ans2 = b * c
ans3 = a * d
ans4 = b * d

ansList = [ans1, ans2, ans3, ans4]

max = None
for ans in ansList:
    if max is None:
        max = ans
    elif max <ans:
        max = ans

print(max)

Solution (Python):
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


a,b,c,d = LI()
ans = -INF
ans = max(ans,a*c)
ans = max(ans,b*d)
ans = max(ans,b*c)
ans = max(ans,a*d)

print(ans)

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

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

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

Solution (Python):
import numpy as np
data = [int(x) for x in input().split(" ")]

a1 = data[0] * data[2]
a2 = data[0] * data[3]
a3 = data[1] * data[2]
a4 = data[1] * data[3]

print(np.array([a1, a2, a3, a4]).max())

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())
p = max(a,b)*max(c,d)
q = max(a,b)*min(c,d)
r = min(a,b)*max(c,d)
s = min(a,b)*min(c,d)
print(max(p,q,r,s))

Solution (Python):
a,b, c, d = [int(x) for x in 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)

Solution (Python):


(a, b, c, d) = (int(i) for i in input().split())

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

m = max(ac, ad, bc, bd)

print(m)

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

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

Solution (Python):
import sys



def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    a, b, c, d = input_int_list()
    ans = max(a * c, a * d, b * c, b * d)
    print(ans)

    return


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):
a,b,c,d = map(int,input().split())

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

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

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

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

Solution (Python):

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy


input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7




def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])



a, b, c, d = inpl()
ans = -INF
tmp = [a * c, b * c, a * d, b * d]
if (a <= 0 and b >= 0)or (c <= 0 and d >= 0):
    ans = 0
else:
    ans = -INF
tmp = max(tmp)
ans = max(ans, tmp)
print(ans)

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

def main(a,b,c,d):
    xy1=a*c
    xy2=a*d
    xy3=b*c
    xy4=b*d
    return max(xy1,xy2,xy3,xy4)

if __name__=='__main__':
    a,b,c,d=readinput()
    ans=main(a,b,c,d)
    print(ans)

Solution (Python):
import sys
arr = [int(x) for x in input().split()]

arr1 = [arr[0], arr[1]]
arr2 = [arr[2], arr[3]]

ans = -1*sys.maxsize

for i in arr1:
	for j in arr2:
		ans = max(ans, i*j)

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):
A, B, C, D = map(int, input().split())
print(max([B*D,A*C,A*D,B*C]))

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







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

Solution (Python):
n = [int(t) for t in input().split()]

ans = []
for x in [0,1]:
    for y in [2,3]:
        ans.append(n[x]*n[y])
print(max(ans))

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

print(max(res, f))

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

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

test=[ac,ad,bc,bd]

print(max(test))

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())
e=max(a*c,a*d)
f=max(b*c,b*d)
ans=max(e,f)
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=list(map(int,input().split()))
print(max(a*c,a*d,b*c,b*d))

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

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

res = a * c
for x, y in [[a, d], [b, c], [b, d]]:
    if x * y > res:
        res = x * y

print(res)

Solution (Python):
a,b,c,d = map(int,input().split())
x = []
t = a*c
r = a*d
p = b*c
q = b*d
z = max(t,r,p,q)
print(z)