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 numpy as np
li= list(map(int,input().split()))
li_s= list(map(np.sign,li))

if li_s[0]==li_s[1] and li_s[2]==li_s[3] and li_s[0]*li_s[2]==-1:
    print(max(li[0]*li[3],li[1]*li[2]))
else:
    print(max(li[0]*li[2],li[1]*li[3]))

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

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

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

Solution (Python):
numbers = list(map(int,input().split()))
ans = -float("INF")
n = 0

while n < len(numbers)-2:
    for i in range(2,4):
        tmp = numbers[n]*numbers[i]
        ans = max(ans,tmp)
    n += 1

print(ans)

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

n2 = a * c
n3 = a * d
n4 = b * c
n5 = b * d

l.append(n2)
l.append(n3)
l.append(n4)
l.append(n5)

print(max(l))

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

Solution (Python):




import sys



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





def debug(*x):
    print(*x, file=sys.stderr)



class atcoder():
    def __init__(s):
        s.A, s.B, s.C, s.D = map(int, sys.stdin.readline().split()) 
        

    def çözmek(s):
        
        res = []
        res.append(s.関数(s.A, s.B, s.C, s.D))
        print(*res)	
    
    def 関数(self, a, b, c, d):
        ac = a * c
        ad = a * d
        bc = b * c
        bd = b * d
        res = max(ac, ad, bc, bd)
        return res 

if __name__ == "__main__":
    ima = atcoder()
    ima.çözmek()

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

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

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

if a[0] > 0:
	if a[3] < 0:
		print(a[0] * a[3])
	else:
		print(a[1] * a[3])

elif a[1] < 0:
	if a[2] < 0:
		print(a[0] * a[2])
	else:
		print(a[1] * a[2])
else:
	if a[3] < 0:
		print(a[0] * a[2])
	elif a[2] > 0:
		print(a[1] * a[3])
	else:
		if a[0] * a[2] > a[1] * a[3]:
			print(a[0] * a[2])
		else:
			print(a[1] * a[3])

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

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

z = x1
if z < x2:
    z = x2
if z < x3:
    z = x3
if z < x4:
    z = x4

print(z)

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

ans=-float('inf')
for i in (a,b):
    for j in (c,d):
        ans=max(ans,i*j)
print(ans)

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

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

a = li[0]
b = li[1]
c = li[2]
d = li[3]


ac = a * c
bc = b * c
ad = a * d
bd = b * d
result = ac
if result < bc:
    result = bc
if result < ad:
    result = ad
if result < bd:
    result = bd
if a <= 0 and 0 <= b and result < 0:
    result = 0
if c <= 0 and 0 <= d and result < 0:
    result = 0
print(result)

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

Solution (Python):

import sys

from sys import stdin
input = lambda: stdin.readline().rstrip()

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)

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

Solution (Python):
a = list(map(int,input().split()))
a_1,a_2 = [],[]
a_1.append(a[0])
a_1.append(a[1])
a_2.append(a[2])
a_2.append(a[3])


max_a = -(10**30)
for i in a_1:
    for l in a_2:
        if(i*l > max_a):
            max_a = i*l

print(max_a)

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

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

a,b,c,d = map(int,input().split())
h = []
h.append(a*c)
h.append(a*d)
h.append(b*c)
h.append(b*d)

print(max(h))

Solution (Python):
i = list(map(int,input().split()))
a = i[0]
b = i[1]
c = i[2]
d = i[3]

ret = 0
if b < 0:
    if d < 0: 
        ret = a * c
    elif c < 0 and d >= 0: 
        ret = a * c
    else: 
        ret = b * c
elif a < 0 and b >= 0:
    if d < 0: 
        ret = a * c
    elif c < 0 and d >= 0:
        ret = max(a*c, b*d)
    else:
        ret = b * d
else:
    if d < 0:
        ret = a * d
    elif c < 0 and d >= 0:
        ret = b * d
    else:
        ret = b * d

print(ret)

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

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

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):
inp = list(map(int,input().split()))
ans = []
for i in range(2):
  for j in range(2,4):
    ans.append(inp[i] * inp[j])
    
print(max(ans))

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

answer = a * c
if answer < a * d:
    answer = a * d
if answer < b * c:
    answer = b * c
if answer < b * d:
    answer = b * d
print(answer)

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

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

if a == 0:
	if b == 0:
		print(0)
	elif d > 0:
		print(b * d)
	else:
		print(0)
elif c == 0:
	if d == 0:
		print(0)
	elif b > 0:
		print(d * b)
	else:
		print(0)
elif b == 0:
	if a == 0:
		print(0)
	elif c < 0:
		print(a * c)
	else:
		print(0)
elif d == 0:
	if c == 0:
		print(0)
	elif a < 0:
		print(a * c)
	else:
		print(0)
elif (a > 0 and d > 0) or (b > 0 and c > 0):
	print(b * d)
elif (b < 0 and c < 0) or (a < 0 and d < 0):
	print(a * c)
else:
	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)

l.sort()
print(max(l))

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

result =[]
result.append(a[0] * a[2])
result.append(a[0] * a[3])
result.append(a[1] * a[2])
result.append(a[1] * a[3])
print(max(result))

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

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

Solution (Python):
if __name__ == "__main__":
    a, b, c, d = map(int, input().split())
    x_list = [a, b]
    y_list = [c, d]
    ans = 0

    if x_list[0] <= 0 and x_list[1] <= 0 and y_list[0] >= 0 and y_list[1] >= 0:
        ans = max(x_list) * min(y_list)
    elif x_list[0] >= 0 and x_list[1] >= 0 and y_list[0] <= 0 and y_list[1] <= 0:
        ans = max(y_list) * min(x_list)
    elif (x_list[0] <= 0 or x_list[1] <= 0) and (y_list[0] <= 0 or y_list[1] <= 0):
        ans = max(min(x_list) * min(y_list), max(x_list) * max(y_list))
    else:
        ans = max(x_list) * max(y_list)

    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())
x1=a*c
x2=a*d
y1=b*c
y2=b*d
l=[x1,x2,y1,y2]
print (max(l))

Solution (Python):
nums = [int(x) for x in input().split()]

sign = [0] * 4
for x in range(4):
    if nums[x] < 0:
        sign[x] = 1

result = min(nums[0:2]) * min(nums[2:])

if sum(sign) == 1 or sum(sign) == 0:
    result = max(nums[0:2]) * max(nums[2:])

if sum(sign) == 2:
    if (sign[0] == 1 and sign[1]) or (sign[2] == 1 and sign[3] == 1):
        if sign[0] == 1:
             result = max(nums[0:2]) * min(nums[2:])
        elif sign[2] == 1:
             result = min(nums[0:2]) * max(nums[2:])
    else:
        cur1 = nums[0] * nums[2]
        cur2 = nums[1] * nums[3]
        if abs(cur1) > abs(cur2):
            result = cur1
        else:
            result = cur2
print(result)

Solution (Python):
a, b, c, d = [int(n) for n in input().split()]
ans = {0:b*d, 2:b*d, 3:a*d, 8:b*d, 10:max(a*c, b*d), 11:a*c, 12:b*c, 14:a*c, 15:a*c}
f = 0
if a<0:
    f += 8
if b<0:
    f += 4
if c<0:
    f += 2
if d<0:
    f += 1
print(ans[f])

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a,b,c,d = MI()
    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())
if (b <= 0):
    if (d <= 0):
        print(a*c)
    elif (c >= 0):
        print(b*c)
    else:
        print(a*c)
elif (a >= 0):
    if (d <= 0):
        print(a*d)
    elif (c >= 0):
        print(b*d)
    else:
        print(b*d)
else:
    if (d <= 0):
        print(a*c)
    elif (c >= 0):
        print(b*d)
    else:
        x = a*c
        y = b*d
        print(max(x, y))

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 b<0 and c>=0 and d>=0:
  print(b*c)
elif a<0 and b<0 and c<0 and d>=0:
  print(a*c)
elif a<0 and b>=0 and c<0 and d<0:
  print(a*c)
elif a<0 and b<0 and c<0 and d<0:
  print(a*c)
elif a<0 and b>=0 and c<0 and d>=0 and abs(a*c)>=abs(b*d):
  print(a*c)
elif a>=0 and b>=0 and c<0 and d<0:
  print(a*d)
else:
  print(b*d)

Solution (Python):
num=input().split()
num=[int(a) for a in num]
numab=[abs(a) for a in num]
x=min(numab[0],numab[1])
y=min(numab[2],numab[3])



if (num[1]>=0 and num[3]>=0) or (num[0]<0 and num[2]<0):
  print(max(num[1]*num[3],num[0]*num[2]))

else:
  print(-1*x*y)

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

Solution (Python):
inputs = input().split()
inputs = list(map(lambda x: int(x), inputs))
x_array = [inputs[0], inputs[1]]
y_array = [inputs[2], inputs[3]]
max = -1000000000000000000

for x in x_array:
    for y in y_array:
        if(max < x * y):
            max = x * y

print(max)

Solution (Python):
num_list = input().split()
a = int(num_list[0])
b = int(num_list[1])
c = int(num_list[2])
d = int(num_list[3])

ab = a * b
cd = c * d

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

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

Solution (Python):
a, b, c, d = map(int, input().split())
list_a_b = [a, b] 
list_c_d = [c, d]
max01, max02, min01, min02 = max(list_a_b), max(list_c_d), min(list_a_b), min(list_c_d)
print(max(max01 * max02, min01 * min02, max01 * min02, max02 * min01))

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

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

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

Solution (Python):
inputs = [int(x) for x in input().split()]
a = inputs[0]
b = inputs[1]
c = inputs[2]
d = inputs[3]


if a == 0 and a + 1 <= b:
    a += 1
if b == 0 and b - 1 >= a:
    b -= 1
if c == 0 and c + 1 <= d:
    c += 1
if d == 0 and d - 1 >= c:
    d -= 1

if (a > 0 and b > 0 and c < 0 and d < 0) or (a < 0 and b < 0 and c > 0 and d > 0):
    
    print(-(min(abs(a), abs(b)) * min(abs(c), abs(d))))    
else:
    
    print(max(a * c, b * d))

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

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

s1 = a*c
s2 = a*d
s3 = b*c
s4 = b*d

score = [s1,s2,s3,s4]
max_score = max(score)
if a<=0<=b and c<=0<=d and max_score<0:
    print(0)
else:
  print(max_score)

Solution (Python):
import itertools

a, b, c, d = map(int,input().split())
ans = -10**19

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

print(ans)

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

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

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

ab_min = min(a, b)
ab_max = max(a, b)
cd_min = min(c, d)
cd_max = max(c, d)

which = []
which.append(ab_max * cd_max)
which.append(ab_max * cd_min)
which.append(ab_min * cd_max)
which.append(ab_min * cd_min)

print(max(which))

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

Solution (Python):

import os
import sys
from io import BytesIO, IOBase

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def li():  return list(mi())

def main():
    a,b,c,d = mi()

    p1 = max(a,b)*max(c,d)
    p2 = max(a,b)*min(c,d)
    p3 = min(a,b)*min(c,d)
    p4 = min(a,b)*max(c,d)

    print(max(p1,p2,p3,p4))
    




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



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

a = num[0]
b = num[1]
c = num[2]
d = num[3]

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

print(max(list))

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

e1 = ac if ac >= bc else bc
e2 = bd if bd >= ad else ad
ans = e1 if e1 >= e2 else e2
print(ans)

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

Solution (Python):
a, b, c, d = map(int, input().split())
if a * c < a * d:
  temp1 = a * d
else:
  temp1 = a * c
if b * c < b * d:
  temp2 = b * d
else:
  temp2 = b * c
if temp1 < temp2:
  print(temp2)
else:
  print(temp1)

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

Solution (Python):
x = list(map(int, input().split()))
l1 = x[:2]
l2 = x[2:]
final = []
for i in range(2):
    for j in range(2):
        final.append(l1[i]*l2[j])
print(max(final))

Solution (Python):
if __name__ == "__main__":

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

    if b <= 0 :
        if d <= 0:
            xy = a * c
        elif d > 0:
            if c > 0:
                xy = b * c
            elif c == 0:
                xy = 0
            elif c < 0:
                xy = a * c
    elif b > 0:
        if a >= 0:
            if d <= 0:
                xy = a * d
            elif d > 0:
                xy = b * d
        elif a < 0:
            if d <= 0:
                xy = a * c
            elif d > 0:
                if c >= 0:
                    xy = b * d
                elif c < 0:
                    if abs(a * c) > abs(b * d):
                        xy = a * c
                    else:
                        xy = b * d

    print(xy)

Solution (Python):
A=input().split()
a=int(A[0])
b=int(A[1])
c=int(A[2])
d=int(A[3])
e=a*c
f=a*d
g=b*c
h=b*d
if e>f:
    f=e
if g>h:
    h=g
if f>h:
    h=f
print(h)

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


n_1 = a * c
n_2 = a * d
n_3 = b * c
n_4 = b * d

check = [n_1, n_2, n_3, n_4]
print(max(check))

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

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

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

print(ans)

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

maxn = a*c

x = a*d
y = b*c
z = b*d

if maxn < x :
    maxn = x
if maxn < y :
    maxn = y
if maxn < z :
    maxn = z

print(maxn)

Solution (Python):
a, b, c, d = [int(x) for x 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):
lst = list(map(int, input().split()))
x_lst = []
y_lst = []
max_lst = []
for i in range(2):
  x_lst.append(lst[i])
  y_lst.append(lst[(i+1)*-1])
for j in range(len(x_lst)):
  for k in range(len(y_lst)):
    max_lst.append(x_lst[j] * y_lst[k])
print(max(max_lst))

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

ans = a*c
if a*d>ans:
    ans = a*d
if b*c>ans:
    ans = b*c
if b*d>ans:
    ans = b*d

print(ans)

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

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

Solution (Python):
a,b,c,d,=map(int,input().split())
x=a*c
y=a*d
z=b*c
w=b*d
s=b*d
if(w<x and z<x and y<x):
  print(x)
elif(w<y and z<y and x<y):
  print(y)
elif(w<z and x<z and y<z):
  print(z)
elif(y<w and z<w and x<w):
  print(w)
else:
  print(s)

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

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

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 b <= 0 and d > 0:
    if c >= 0:
        print(b * c)
    else:
        print(a * c)
elif b > 0 and d <= 0:
    if a >= 0:
        print(a * d)
    else:
        print(a * c)
elif b <= 0 and d <= 0:
    print(a * c)
elif b == 0 or d == 0:
    print(0)
else:
    if c < 0 and a < 0:
        print(max(a * c,b * d))
    else:
        print(b * d)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from math import gcd
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7



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

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

if b<0 and d<0:
    print(a*c)
elif a>=0 and c>=0:
    print(b*d)
elif b<0 and c>=0:
    print(b*c)
elif a>=0 and d<0:
    print(a*d)
else:
    if a*c>=b*d:
        print(a*c)
    else:
        print(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())


m = [a,b]
n = [c,d]

if a < 0 and 0 < b:
    m.append(0)

if c < 0 and 0 < d:
    n.append(0)

mx = -float('inf')

for ms in m:
    for ns in n:
        j = ms * ns
        if mx < j:
            mx = j



print(mx)

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())
x = [a, b]
y = [c, d]
maxVal = max(x)*max(y)
if min(x)*min(y) > maxVal and min(x)*min(y) > min(x)*max(y) and min(x)*min(y) > max(x)*min(y):
    res = min(x)*min(y)
elif min(x)*max(y) > maxVal and min(x)*max(y) > min(x)*min(y) and min(x)*max(y) > max(x)*min(y):
    res = min(x)*max(y)
elif max(x)*min(y) > maxVal and max(x)*min(y) > min(x)*max(y) and max(x)*min(y) > min(x)*min(y):
    res = max(x)*min(y)
else:
    res = maxVal
print(res)

Solution (Python):
s = input().split()
x_min = int(s[0])
x_max = int(s[1])

y_min = int(s[2])
y_max = int(s[3])

if(x_max>0 and y_max>0 and x_min>0 and y_min>0):
	print(x_max*y_max)
elif(x_max<0 and y_max < 0 and x_min<0 and y_min < 0):
  	print(x_min * y_min)
elif(x_max < 0 and y_min > 0):
  	print(x_max * y_min)
elif(x_min > 0 and y_max < 0):
  	print(x_min * y_max)
else:
	if(x_min * y_min > x_max * y_max):
		print(x_min * y_min)
	else:
		print(x_max * y_max)

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

one = list(i[:2])
two = list(i[2:])

tmp = -100000000000000000000

for i in one:
    for j in two:
        ans = i * j
        if ans > tmp:  
            tmp = ans

print(tmp)

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

ans = [0 for i in range(4)]
ans[0] = a * c
ans[1] = a * d
ans[2] = b * c
ans[3] = b * d
print(max(ans))

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

W = a*c

if(a*d >= W):
    W = a*d

if(b*c >= W):
    W = b*c

if(b*d >= W):
    W = b*d

print(W)

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

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

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

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

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

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

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

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

print(max(L))

Solution (Python):
number = input().split(" ")
a = int(number[0])
b = int(number[1])
c = int(number[2])
d = int(number[3])

x = a*c
y = a*d
z = b*c
s = b*d

ans = [x,y,z,s]
ans.sort()
print(ans[3])

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

ans = []

ans.append(a * c)
ans.append(b * c)
ans.append(a * d)
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)
if (a<0 and b>=0) or (c<0 and d>=0):
  Ans=max(Ans,0)
print(Ans)

Solution (Python):
if __name__=="__main__":
  l=[int(i) for i in input().split()]
  print(max(l[0]*l[2],l[0]*l[3],l[1]*l[2],l[1]*l[3]))

Solution (Python):
n = input()

a, b, c, d = n.split(" ")
a = int(a)
b = int(b)
c = int(c)
d = int(d)

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):
x = list(map(int, input().split()))
a = x[0]
b = x[1]
c = x[2]
d = x[3]

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

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

ans = []

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

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

print(max(ans))

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

p = [0] * 4

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

ans = max(p)

print(ans)

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

ab = [a, b]
cd = [c, d]
lst = []

for i in ab:
    for j in cd:
        lst.append(i * j)

print(max(lst))

Solution (Python):

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

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

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

Solution (Python):
line = input().rstrip().split(" ")
a = int(line[0])
b = int(line[1])
c = int(line[2])
d = int(line[3])

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

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

Solution (Python):
x = list(map(int,input().split()))
a = x[0]
b = x[1]
c = x[2]
d = x[3]

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):
num = list(map(int, input().split(" ")))
if num[0] >= 0 and num[2] >= 0 or num[0] >= 0 and num[3] >=0 or num[2] >= 0 and num[1] >= 0:
    print(num[1]*num[3])
elif num[1] <= 0 and num[3] <= 0 or num[1] <= 0 and num[2] <=0 or num[0] <= 0 and num[3] <= 0:
    print(num[0]*num[2])
elif num[0] >= 0 and num[3] <= 0:
    print(num[0]*num[3])
elif num[1] <= 0 and num[2] >= 0:
    print(num[1]*num[2])
else:
    if num[0]*num[2] >= num[1]*num[3]:
        print(num[0]*num[2])
    else:
        print(num[1]*num[3])

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


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

ans=max(x2,x3,x4,x5)

print(ans)

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

ab=[L[0],L[1]]
cd=[L[2],L[3]]
ans=-(10**100)
for i in ab:
    for j in cd:
        ans=max(ans,i*j)
print(ans)

Solution (Python):
def main():

  a = list(map(int,input().split()))
  
  sum = a[0]*a[2]
  for i in range(0,2):
    for j in range(2,4):
      if sum < a[i]*a[j]:
        sum = a[i]*a[j]
        
  print(sum)
    
if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
if __name__ == "__main__":
    a, b, c, d=(int(x) for x in input().split())
    arr = np.array([a*c, a*d, b*c, b*d])
    print(arr.max())

Solution (Python):

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

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

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

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

Solution (Python):
import itertools
def main():
    l = list(map(int, input().split()))
    all_pair = []
    all_pair.append(l[0]*l[2])
    all_pair.append(l[0]*l[3])
    all_pair.append(l[1]*l[2])
    all_pair.append(l[1]*l[3])
    print(sorted(all_pair)[-1])
if __name__ == '__main__':
    main()

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

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

cross_list.sort()
print(cross_list[3])

Solution (Python):
a, b, c, d = map(int, input().split())
l = [a, b]
k = [c, d]
g = a*c
for i in l:
    for j in k:
        if i*j > g:
            g = i*j
print(g)

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

print(max(combinations))

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