peterverebics/CodeNet_Python_118 huggingface dataset:
a,b,c,d=map(int,input().split())
if b >= 0 and d >= 0:
    print(b*d)
elif b <= 0 and d <= 0:
    print(a*c)
elif b < 0 and d > 0:
    print(b*c)
else:
    print(a*d)
import itertools
l=list(map(int, input().split()))
c=itertools.combinations(l,2)
ans=l[0]*l[1]
for i in c:
  if i[0]*i[1]>ans:
    ans=i[0]*i[1]
print(ans)
#[int(i) for i in input().split()]
a,b,c,d = [int(i) for i in input().split()]
x=y=0
if (b>0 and d>0):
	x=b
	y=d
elif (b<=0 and d<=0):
	x=a
	y=c
else:
	if b<=0:
		x=b
	else: x=a
	if d<=0:
		y=d
	else:y=c
	
print(x*y)
import math

def a():
    x = int(input())
    if x == 0:
        print(1)
    else:
        print(0)


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

    if a*c >b*d:
        print(a*c)
    else:
        print(b*d)



def c():
    pass



def d():
    pass


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

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

  a = list(map(int,input().split()))
  
  sum = a[0]*a[3]
  if sum < a[0]*a[2]:
    print(a[0]*a[2])
  elif sum < a[1]*a[2]:
    print(a[1]*a[2])
  elif sum < a[1]*a[3]:
    print(a[1]*a[3])
  else:
    print(sum)
    
if __name__ == '__main__':
    main()
a,b,c,d = map(int,input().split())

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

if 0 <= a or 0 <= c:
    if d < 0:
        print(a*d)
    elif b < 0:
        print(b*c)
    else:
        print(b*d)
elif 0 < b or 0 < d:
    print(a*c)
z = list(map(int,input().split()))

w = z[0]*z[3]

for x in range(z[0],z[1]):
    for y in range(z[2],z[3]):
        if x*y >= w:
            w = x*y
print(w)
a, b, c, d = map(int, input().split())
x = [a, b]
y = [c, d]

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

print(ans)
import numpy as np
a, b, c, d = map(int, input().split())
max = -999999
x = [a,b]
y = [c,d]
for i in x:
    for j in y:
        if i*j > max:
            max = i*j
print(max)
a, b, c, d = map(int, input().split())
if b * d >= 0:
  print(b * d)
else:
  z = []

  for x in range(a, b + 1):
    for y in range(c, d + 1):
      z.append(x * y)
  print(max(z))
A, B, C, D = input().split()

AC = int(A)*int(C)
BD = int(B)*int(C)

if AC > BD:
  print(AC)
  
else:
  print(BD)
a,b,c,d = map(int,input().split())
if a >= 0 and c >= 0:
    print(int(b*d))
elif b <= 0 and d <= 0:
    print(int(a*c))
elif b*c > a*d:
    print(int(b*c))
else:
    print(int(a*d))
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*c)
list1.sort()
print(list1[3])
a,b,c,d = map(int,input().split())
cnt = 0

if b <= 0:
  cnt+=1
if d <= 0:
  cnt+=1

if cnt > 0:
  if cnt == 1:
    if b < 0:
      print(b*c)
    else:
      print(d*a)
  elif cnt == 2:
    print(a*c)
else:
  print(b*d)
a, b, c, d = map(int, input().split())
print(max(a * b, a * c, b + c, b * d))
a,b,c,d=map(int,input().split())
e=max(a*b,a*c)
f=max(b*c,b*d)
print(max(e,f))
a,b,c,d = map(int, input().split())
if b >= 0 and d >= 0:
    if a <= 0 and c <= 0:
        if (a-0)*(-1) >= b-0 and (c-0)*(-1) >= d-0:
            print(a * c)
        if (a-0)*(-1) <= b-0 and (c-0)*(-1) <= d-0:
            print(b * d)
    else:
        print(b * d)
elif a*b >= 0 and c*d >= 0:
    if a*c <= 0:
        print(a * d)
    else:
        print(a * c)
else:
    print(a * c)
a,b,c,d=list(map(int,input().split()))
if a>=0 and c>=0:
    one=b
    two=d

elif a<0 and c<0:
    one=a
    two=c

elif a>=0 and c<0:
    one=a
    two=d
else:
    one=b
    two=c


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

if c < 0 or d < 0:
    x = min(a, b)
else:
    x = max(a, b)

if x < 0:
    y = min(c, d)
else:
    y = max(c, d)

print(x * y)
a,b,c,d = map(int,input().split())
if a*d > b*d:
    print(a*d)
elif a*c > b*d:
    print(a*c)
elif b*c > b*d:
    print(b*c)
else:
    print(b*c)
a,b,c,d = map(int,input().split())
print(max(a*b,b*c,c*d,d*a,b*c,b*d,c*d))
import sys
import collections as cc
import math as mt
I=lambda:list(map(int,input().split()))
a,b,c,d=I()
print(max(a*c,a*d,b*d,b*d))
a,b,c,d = map(int,input().split())

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

if b <= 0 and d <= 0:
  print(a*c)
elif b <= 0 and d > 0:
  print(b*c)
elif d <= 0 and b > 0:
  print(a*d)
else:
  print(b*d)
l=list(map(int,input().split()))
if l[1]<=0 and l[3]<=0:
	print(l[0]*l[2])
elif l[1]<0:
	print(l[1]*l[2])
elif l[3]<0:
	print(l[0]*l[3])
else:
	print(l[1]*l[3])
a, b, c, d = map(int, input().split())
if b == 0:
    b -= 1
if d == 0:
    d -= 1
print(max(a * c, a * d, b * c, b * d))
nums = input().split(' ')
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
d = int(nums[3])

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

ans = - 10 ** 9
for i in range(4):
    if multi[i] > ans:
        ans = multi[i]

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

mab = max(abs(a), abs(b))
mcd = max(abs(c), abs(d))


print(mab*mcd)
a,b,c,d=input().split()
if int(a)<0 and int(c)<0:
  if int(a)*int(c)<int(b)*int(d):
    print(int(b)*int(d))
  else:
    print(int(a)*int(c))
elif int(a)<0:
  print(int(b)*int(d))
elif int(c)<0:
  print(int(b)*int(d))
else:
  print(int(b)*int(d))
a,b,c,d=map(int,input().split())
n1=[]
if b>0 and d>0:
    n1.append(b*d)
elif a<0 and c<0:
    n1.append(a*c)
else:
    if b<0 and c>0:
        n1.append(b*c)
    elif a>0 and d<0:
        n1.append(a*d)
    else:
        n1.append(0)
print(max(n1))
a,b,c,d=map(int,input().split())

l=[a,b,c,d]
xy=[]
for i in range(4):
    for j in range(i+1,4):
        xy.append(l[i]*l[j])

print(max(xy))
a,b,c,d = map(int, input().split())
if(a >= 0 and c >= 0):
  print(b*d)
elif(a > 0 and c < 0):
  print(a * d)
elif(a < 0 and c > 0):
  print(b * c)
else:
  print(a * c)
# coding: utf-8
# Your code here!
arr = input().split()

a = int(arr[0])
b = int(arr[1])

c = int(arr[2])
d = int(arr[3])

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

x2 = min(a,b)
y2 = min(c,d)

ans = max(x*y,x2*y2)

print(ans)
a,b,c,d = map(int,input().split())
A = max(a,b)
B = max(c,d)
if A <= 0 and B > 0:
  A = max(a,b)
  B = min(c,d)
elif A >= 0 and B < 0:
  A = min(a,b)
  B = max(c,d)
  
elif A <= 0 and B <= 0:
  A = min(a,b)
  B = min(c,d)

print(A*B)
a, b, c, d = map(int, input().split())
 
if (a >= 0 and c >= 0) or (b <= 0 and d <= 0): print(b*d)
elif (a >= 0 and d <= 0): print(b*c)
elif (b <= 0 and c >= 0): print(a*d)
a,b,c,d=map(int,input().split())
print(a*b,a*c,a*d,b*c,b*d,c*d)
a, b, c, d = map(int, input().split())
if b <= 0 and d <= 0:
    print(c * a)

elif b > 0 and d > 0:
    print(b * d)

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

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

else:
    print(b * d)
a,b,c,d=map(int,input().split()) 
x = max(a*c,0,b*d)
print(x)
a,b,c,d = map(int,input().split())

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

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

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

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

    if (a < 0 and 0 < b):
        ans = min(ans, 0)
    if (c < 0 and 0 < d):
        ans = min(ans, 0)
    print(ans)


if __name__ == "__main__":
    main()
a,b,c,d = map(int,input().split())
m = a*c
if a*d > m:
  m = a*d
elif b*c > m:
  m = b*c
elif b*d > m:
  m = b*d
 
print(m)
a, b, c, d = map(int, input().split())

max_value = max([a*c, a*d, b*c, b*d])
import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

a,b,c,d=MI()
ans=-10**16
ans=max(ans,a*c)
ans=max(ans,a*d)
ans=max(ans,b*c)
ans=max(ans,b*d)
if a<=0<=b or c<=0<=d:
    ans=max(0,ans)
print(ans)
lst = [ int(i) for i in input().split() ]

ans = sorted(lst)

print(ans[-1]*ans[-2])
a, b, c, d = map(int, input().split())

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

if (li[0] or li[1])>0:
  if (li[2] or li[3])>0:
    x=max(li[0],li[1])
    y=max(li[2],li[3])
    print(x*y)
  else:
    x=min(li[0],li[1])
    y=max(li[2],li[3])
    print(x*y)
else:
  if (li[2] or li[3])>0:
    x=max(li[0],li[1])
    y=min(li[2],li[3])
    print(x*y)
  else:
    x=min(li[0],li[1])
    y=min(li[2],li[3])
    print(x*y)
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(li[1]*li[2])
else:
    print(max(li[0]*li[2],li[1]*li[3]))
a = list(map(int,input().split()))
max_a = -(10**30)
import itertools
for i in itertools.combinations(a,2) :
    #print(i[0]*i[1])
    if( i[0]*i[1] > max_a):
        max_a = i[0]*i[1]

print(max_a)
def maxProduct(nums):
        B = nums[::-1]
        
        for x in range(1,len(nums)):
            if nums[x - 1] != 0:
                nums[x] *= nums[x - 1]
                
            if B[x - 1] != 0:
                B[x] *= B[x - 1]
        return max(nums + B)
nums=list(map(int,input().split()))
print(maxProduct(nums))
a,b,c,d=map(int,input().split())

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

elif b==0 and d==0:
  print(a*c)

elif b<0 and d<0:
  print(a*c)
  
else:
  print(b*d)
a,b,c,d = map(int, input().split())
x = a
y = c
max = x * y
if b < 0:
  print(max)
elif b == 0 and c > 0:
  print(0)
else:
  for x in range(a,b + 1):
    for y in range(c,d + 1):
      if x * y > max:
        max = x * y
  print(max)
a, b, c, d = map(int, input().split())

if a >= 0 and b >= 0 and c >= 0 and d >= 0:
  print(b * d)
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 * d)
elif a <= 0 and b <= 0 and c <= 0 and d <= 0:
  print(b * c)
a, b , c, d = map(int, input().split())
if( b<0 and d>0):
    print(b*c)
elif( b>0 and d<0):
    print(a*d)
elif( b>0 and d>0):
    print(b*d)
else:
    print(a*c)
a,b,c,d = map(int,input().split())

if(a >= 0 and d <= 0):
    print(a*d)
elif(b<= 0 and d <= 0):
    print(a*c)
elif((b <= 0 and c >= 0) or (b > 0 and d < 0)):
    print(b*c)
elif(b > 0 and c > 0):
    print(b*d)
elif(a*c > a*d):
    print(a*c)
elif(a*c < a*d):
    print(a*d)
a, b, c, d = [int(x) for x in input().split()]
if b < 0 or d < 0:
  if b < 0 and d < 0:
    print(a * c)
  else:
    print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d)))
else:
  print(b * d)
a,b,c,d=map(int,input().split())

if b>0 & d>0:
  print(int(b*d))
  
elif b<0 & d<0:
  print(int(a*c))

elif  a>0 & d<0:
  print(int(a*d))
  
else:
  print(int(b*c))
[a,b,c,d] = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)

if b > 0 and d > 0:
    print(b*d)
elif b > 0 and d <= 0:
    print(a*d)
elif b <= 0 and d > 0:
    print(b*c)
elif b <= 0 and d <= 0:
    print(a*c)
array = input().split()

a = int(array[0])
b = int(array[1])
c = int(array[2])
d = int(array[3])

if b > 0 or d > 0:
    print(b*d)
else:
    print(a*c)
if __name__ == "__main__":
  li = list(map(int, input().split()))
  array = []
  array.append(li[0] * li[1])
  array.append(li[0] * li[2])
  array.append(li[0] * li[3])
  array.append(li[1] * li[2])
  array.append(li[1] * li[3])
  array.append(li[2] * li[3])
  
  print(max(array))
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 21:03:42 2020

@author: naoki
"""

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

if ac>=bd:
    print(ac)
else:
    print(bd)
n = list(map(int, input().split())) 

i = n[0]
j = n[2]
max = 0

for i in range(n[1]):
    for j in range(n[3]):
        if max < i * j:
            max = i*j

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

if a * c <= 0 and b * d <= 0:
  print(a * d)
else:
  print(max([a * c, b * d]))
a = [int(x) for x in input().split()]
print(a[1]*a[3])
a, b, c, d = map(int, input().split())
res1 = a * c
res2 = a * d
res3 = b * c
res4 = b * d
if ((-10**9) <= a, c <= b, d <= (-10**9) and (10**9)):
    if (res1>res2 and res1>res3 and res1>res4):
        print(res1)
    if (res2>res3 and res2>res4 and res2>res1):
        print(res2)
    if (res3 > res4 and res3 > res2 and res3 > res1):
        print(res1)
    if (res4>res2 and res4>res3 and res4>res1):
        print(res4)
import numpy as np
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]
if a<=b and c<=d:
    mat = np.array([])
    for i in [a,b]:
        for j in [c,d]:
            mat = np.append(mat, i*j)
    print(int(np.max(mat)))
s = input().split()
x_min = int(s[0])
x_max = int(s[1])

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


max_value=0

for x in range(x_min,x_max+1):
  for y in range(y_min,y_max+1):
    if(x*y > max_value):
      max_value = x*y
      
print(max_value)
a,b,c,d=map(int,input().split(" "))
print(max(a,b)*max(c,d))
# coding: utf-8
a,b,c,d = map(int,input().split())

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

a = int(a)
b = int(b)
c = int(c)
d = int(d)

if b > 0 and d > 0:
    print(b*d)
elif b <= 0 and d <= 0:
    print(min(a,b)*min (c,d))
elif b<=0 and c > 0:
    print(max(a,b)*min(c,d))
elif a>0 and d <= 0:
    print(min(a,b)*max(c,d))
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)
M=max(l)
if (a<=0 and b>=0) or (c<=0 and b>=0):
  print(max(M,0))
else:
  print(M)
a,b,c,d=map(int,input().split())

max=a*b
for i in  (a,b):
    for j in (c,d):
        if max < i*j:
            max = i*j

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

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

print(max(X[0]*X[1], X[1]*X[2], X[2]*X[3], X[3]*X[0], X[0]*X[2],
         X[1]*X[3]))
a,b,c,d = map(int, input().split())
ans = max(a*b, a*c, a*d, b*c, b*d, c*d)
print(ans)
a, b, c, d = map(int, input().split())
print(max(a*c, b*d, a*c, b*d))
a,b,c,d=map(int,input().split())
if a >= 0 and c >= 0:
    print(b * d)
elif b < 0 and d < 0:
    print(a * c)
elif a > 0 and d < 0:
    print(a * d)
elif b < 0 and c > 0:
    print(b * c)
a, b, c, d = map(int, input().split())

if b > 0 and d > 0:
    print(b*d)

else:
    print(min(abs(a),abs(b)) * min(abs(c),abs(d)) * -1)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-09-13 20:49:18 +0900
# LastModified: 2020-09-13 21:05:17 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


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


if __name__ == "__main__":
    main()
a, b, c, d = tuple(map(int, tuple(input().split(" "))))
print(max(max(a, b) * max(c, d), min(a, b) * min(c, d)))
a,b,c,d=map(int,input().split()) 
x = max(a*c,0,b*d,a*d,b*c)
print(x)
a, b, c, d = map(int, input().split())

if b >= 0 and d >= 0 and a <= 0 and c <= 0:
    e = b*d
    f = a*c
    if e > f:
        print(e)
    else:
        print(f)
else:
    e = abs(a)
    f = abs(b)
    g = abs(c)
    h = abs(d)
    l = [e,f,g,h]
    l.sort()
    print(-1*l[0]*l[1])
from math import inf
a,b,c,d = map(int, input().split())
if b < a:
  b, a = a, b
if d < c:
  c, d = d, c
high = -inf
for i in range(b, a):
  for j in range(d, c):
    prod = i*j
    if high < prod:
      high = prod
print(high)
a,b,c,d = map(int,input().split())

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

print(e)
a, b, c, d = map(int, input().split())
if b <= 0 and d <= 0:
    print(a * c)
elif (b <= 0 and c >= 0) or (a >= 0 and d <= 0):
    print(-min(abs(a), abs(b)) * min(abs(c), abs(d)))
else:
    print(b * d)
a,b,c,d = map(int,input().split())

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

if(max(a,b) <=0 and max(c,d) > 0):
  print( min(c,d)*max(a,b))
elif(max(a,b) > 0 and max(c,d) <=0):
  print(min(a,b)*max(c,d))
elif(max(a,b) > 0 and max(c,d) > 0):
  print(max(a,b)*max(c,d))
elif(max(a,b) < 0 and max(c,d) < 0):
  print(min(a,b)*min(c,d))
elif(max(a,b)==0 and max(c,d) ==0):
  print(min(a,b)*min(c,d))
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:
      print(b*d)
    else:
      print(a*d)
  else:
    if d>0:
      print(b*c)
    else:
      print(b*c)
a , b , c , d = map(int,input().split())
if (a*d) >= (b*c):
    if (a*d) >= (b *d):
        if (a*d) >= (a*c):
            print(a*d)
        else:
            print(a*c)
else:
    if (b*c) >= (a *c):
        if (b*c) >= (b *d):
            print(b * c)
        else:
            print(b * d)
a, b, c, d = map(int, input().split())

max = 0
if max < a*b:
    max = a*b
elif max < a*c:
    max = a*c
elif max < a*d:
    max = a*d
elif max < b*c:
    max = b*c
elif max < b*d:
    max = b*d
elif max < c*d:
    max = c*d
print(max)
a,b,c,d = map(int,input().split())
ans = -10**9
ab = [a,b]
cd = [c,d]
for i in ab:
  for j in cd:
    ans = max(i*j,ans)
print(ans)
a,b,c,d=map(int,input().split())
if a>=0 and c>=0:
  print(b*d)
elif b<=0 and d<=0:
  print(a*c)
elif a>=0 and d<=0:
  print(a*d)
elif b<=0 and c>=0:
  print(b*c)
a, b, c, d = map(int, input().split())

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

x = False
y = False

if max(n[0],n[1]) <= 0:
    x = True
    
if max(n[2],n[3]) <= 0:
    y = True

if x and y:
    ans = min(n[0],n[1]) * min(n[2],n[3])
elif y:
    ans = min(n[0],n[1]) * max(n[2],n[3])
elif x:
    ans = max(n[0],n[1]) * min(n[2],n[3])
else:
    ans = max(n[0],n[1]) * max(n[2],n[3])

print(ans)
a,b,c,d = map(int,input().split())
ans = []
for i in b,c,d:
    ans.append(a*i)
for j in c,d:
    ans.append(b*i)
ans.append(c*d)

print(max(ans))
a,b,c,d = map(int,input().split())
if a*c >= b*d:
    if a*c >= a*d:
        if a*c >= b*c:
            print(a*c)
if a*d >= b*d:
    if a*d >= b*c:
        if a*d >= a*c:
            print(a*d)
if b*c >= b*d:
    if b*c >= a*d:
        if b*c >= a*c:
            print(b*c)
if b*d >= b*c:
    if b*d >= a*d:
        if b*d >= a*c:
            print(b*d)
L = list(map(int, input().split()))
X = L[:2]
Y = L[2:]

# ans = 0
ans_max = -10**9

for x in X:
    for y in Y:
        ans = x * y
        if ans > ans_max:
            ans_max = ans
print(ans_max)
a,b,c,d=map(int,input().split())

if a*b>0 and c*d>0 and (a<0 or c<0):
  ans=max(a*d,b*c)
else:
  ans=max(a*c,b*d)
print(ans)
# coding: utf-8
# Your code here!

input_line = input().split(" ")
a = int(input_line[0])
b = int(input_line[1])
c = int(input_line[2])
d = int(input_line[3])

if b > 0 and d > 0:
    print(b * d)
if b <= 0 and d <= 0:
    print(a * c)
if b > 0 and d <= 0:
    print(b * d)
if b <= 0 and d > 0:
    print(b * d)
a, b, c, d = map(int, input().split())
x = max([a, b])
y = max([c, d])
print(x*y)
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=list(map(int , input().split()))
ans=-1
for i in range(4):
    for j in range(i+1,4):
        if ans==-1:
            ans=a[i]*a[j]
        else:
            ans=max(ans, a[i]*a[j])
print(ans)
a = list(map(int,input().split()))
max_a = 10**30
import itertools
for i in itertools.combinations(a,2) :
    #print(i[0]*i[1])
    if( i[0]*i[1] > max_a):
        max_a = i[0]*i[i]

print(max_a)
a,b,c,d=[int(_) for _ in input().split()]
if a<0 or b<0 or c<0 or d<0:
    print(min(a,b)*max(c,d))
else:
    print(max(a,b)*max(c,d))
a, b, c, d = [int(i) for i in input().split()]
list1 = [a,b]
list2 = [c,d]
ans = 0
max = float("-inf")
print(list1)
for i in list1:
  for j in list2:
    ans = i * j
    if (ans > max):
      max = ans
print(max)
a,b,c,d = (int(x) for x in input().split())

if a*b<=0 and c*d<=0:
    if a*c > b*d:
        print(a*c)
    else:
        print(b*d)
    # print("-+-+")
elif b*d>=0:
    # print("b:d>0")
    print(b*d)
elif b<0:
    # print("b<0")
    print(b*c)
else:
    # print("b>0")
    print(a*d)
a,b,c,d=map(int,input().split())
if d<0<b:
  print(d*a)
elif b<0<d:
  print(b*c)
elif b>=0:
  print(b*d)
else:
  print(a*c)
a, b, c, d = map(int, input().split())
if b < 0 and d < 0:
    print(d*b)

elif b < 0 and d > 0:
    print(c * b)


elif b > 0 and d < 0:
    print(d * a)

elif a > 0 and b > 0:
    print(a * b)

else:
    print(c * a)
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(bd)
elif bd>ac and bd>ad and bd>bc:
  print(bd)
a,b,c,d = map(int, input().split())

if b <= 0 and d > 0:
    print(b * c)
elif b > 0 and d <= 0:
    print(a * d)
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(abs(a),b) * max(abs(c),d))
    else:
        print(b * d)
i = list(map(int,input().split()))
a = i[0]
b = i[1]
c = i[2]
d = i[3]

if a >= 0 and c >= 0:
    print(b*d)
elif a < 0 and b >= 0 and c < 0 and d >= 0:
    if a*c >= b*d:
        print(a*c)
    else:
        print(b*d)
elif b <= 0 and c >= 0:
    print(b*c)
elif b >= 0 and c <= 0:
    print(a*d)
else:
    print(a*c)
a,b,c,d=map(int,input().split())
print(max(b*d,a*c))
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(l)
print(max(l))
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
if a>0:
  if b*d>a*d:
    print(b*d)
  else:
    print(a*d)
else:
  if a*c>b*c:
    print(a*c)
  else:
    print(b*c)
def main():
    a,b,c,d=(int(x) for x in input().split())
    if b*d>=0:
        x=b
        y=d
        print(x*y)
    elif a<=0 and c<=0:
        x=a
        y=c
        print(x*y)
    elif b>d:
        x=a
        y=d
        print(x*y)
    elif b<d:
        x=b
        y=c
        print(x*y)
if __name__ == "__main__":
    main()
a, b, c, d = map(int, input().split())

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

xp = True if a + b > 0 else False
yp = True if c + d > 0 else False

if xp:
  if yp:
    ans = b * d
  else:
    ans = a * d
else:
  if yp:
    ans = b * c
  else:
    ans = b * d

print(ans)