peterverebics/CodeNet_Python_118 huggingface dataset:
#!/usr/bin/env python3
a,b,c,d=map(int,input().split())
if b>0 and d>0:
    print(b*d)
elif b<0 and c>0:
    print(b*c)
elif a>0 and d<0:
    print(a*d)
else:
    print(a*c)
a,b,c,d = map(int,input().split())
aa = abs(a)
bb = abs(b)
cc = abs(c)
dd = abs(d)
if a > 0 and c > 0:
  print(b*d)
elif b < 0 and d < 0:
  print(a*c)
elif a == 0 or b == 0 or c == 0 or d == 0:
  print(0)
elif b < 0:
  print(b*c)
else:
    print(a*d)
a,b,c,d=map(int,input().split())
x=[]
x.append(max(a,b)*max(c,d))
x.append(max(a,b)*min(c,d))
x.append(min(a,b)*max(c,d))
x.append(min(a,b)*max(c,d))
print(max(x))
a, b, c, d = map(int,input().split())
x = 0
y = 0
if a >= 0 and c >= 0:
  x = b
  y = d
elif a >= 0 and d < 0:
  x = a
  y = d
elif b < 0 and c >= 0:
  x = b
  y = c
elif b <= 0 and d <= 0:
  x = a
  y = c

print(x * y)
a,b,c,d = map(int,input().split())

ans = -10**9

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

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

m = -9999

ac = a * c
if ac >= m:
  m = ac

ad = a * d
if ad > m:
  m = ad

bc = b * c
if bc >= m:
  m = bc

bd = b * d
if bd >= m:
  m = bd

print(m)
def main():
    a,b,c,d = map(int,input().split())
    
    ans = -1 * 10**10
    
    for i in (a,b):
        for j in (c,d):
            if i*j > ans:
                ans = i*j
    print(ans)
    
if __name__ == '__main__':
    main()
n = list(map(int, input().split()))
print(n[1]*n[3])
a,b,c,d=map(int,input().split())
ans=max(a*c,b*d,a*d,b*d)
print(ans)
a, b, c, d = map(int, input().split())


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

max = a[0]*a[2]
if max < a[0]*a[3]:
    max = a[0]*a[3]
if max < a[1]*a[2]:
    max = a[1]*a[2]
if max < a[1]*a[3]:
    max < a[1]*a[3]

print(max)
a,b,c,d=map(int,input().split())
x,y=0,0
if a>b:
  x=a
else:
  x=b
if c>d:
  y=c
else:
  y=d
print(x*y)
a = sorted(list(map(int, input().split())))
print(max(
  a[0] * a[1], a[-2] * a[-1]
))
num = input().split()
a = int(num[0])
b = int(num[1])
c = int(num[2])
d = int(num[3])
if a >= 1 and c >= 1:
  print(b * d)
elif a <= 0 and c <= 0:
  print(a * c)
elif b <= 1:
  print(b * c)
elif d <= 1:
  print(a * d)
a, b, c, d = [int(x) for x in input().split()]
m1 = max(a,b)
m2 = max(c,d)
if(m1<=0 and m2<=0):
  print(min(a,b)*min(c,d))
elif(m1>0 and m2<=0):
  print(min(a,b)*m2)
elif(m1<=0 and m2>0):
  print(m1*min(c,d))
else:
  print(m1*m2)
a,b,c,d = map(int, input().split())
if a>0 and c>0: print(b*d)
else:
  if b>0 and d>0:
    print(b*d)
  elif b<0 and d>0:
    print(max(a,b)*min(c,d))
  elif d<0 and b>0:
    print(min(a,b)*max(c,d))
  else:
    print(min(a,b)*min(c,d))
a,b,c, d = map(int,input().split())

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

if a>0:
    if d<0:
        M=a*d
    else:
        M=b*d

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

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

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

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

print(x)
a,b,c,d=map(int,input().split())
print(max(a*c,b*d))
a,b,c,d = map(int, input().split())
if b*d > 0:
    print(b*d)
else:
    print(-1*min(abs(a),abs(b))*min(abs(c),abs(d)))
a, b, c, d = map(int, input().split())

ab = a
cd = c
ab_flag = 0
cd_flag = 0

if abs(a) < abs(b):
    ab = b
    ab_flag = 1

if abs(c) < abs(d):
    cd = d
    cd_flag = 1

ans = ab * cd

if ans < 0:
    if a > 0:
        ans = a * d
    elif c > 0:
        ans = b * c

print(str(ans))
a, b, c, d = [int(e) for e in input().split(" ")]
if((0 <= a or 0 <= c) and (0 <= b and 0 <= d)):
    #print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    #print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    #print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    #print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))
inputs = [int(x) for x in input().split()]
a = inputs[0]
b = inputs[1]
c = inputs[2]
d = inputs[3]

# Avoid using 0
if a == 0:
    a += 1
if b == 0:
    b -= 1
if c == 0:
    c += 1
if d == 0:
    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):
    # Return the max negative value
    print(-(min(abs(a), abs(b)) * min(abs(c), abs(d))))    
else:
    # Return the max positive value
    print(max(a * c, b * d))
a = list(map(int,input().split()))
max = -10 ** 11
for i in range(2):
  for j in range(2,4):
    p = a[i] * a[j]
    #print(p)
    if abs(max) < abs(p) and 0 < p:
      max = p
    elif abs(p) < abs(max) and 0 > p:
      max = p
print(max)
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)
a,b,c,d=map(int,input().split())
if a>=b:
    x=a
elif a<b:
    x=b
if c>=d:
    y=c
elif d>c:
    y=d
print(x*y)
a, b, c, d = map(int,input().split())
ans = 0
if a*c >= 0 and b*d >= 0:
    ans = max(a*c,b*d)
else:
    ans = max(a*d,b*c)
print(ans)
a, b, c, d = list(map(int, input().split()))

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

if a < 0 and b < 0 :
    print(b*c)
elif a < 0 and b >=0:
    if c < 0 and d < 0:
        print(a*c)
    elif c < 0 and d >=0:
        if a * c < b * d :
            print(b*d)
        else :
            print(a*c)
    else :
        print(b*d)
elif a>=0 and b >=0:
    if c < 0 and d < 0:
        print(a*d)
    else :
        print(b*d)
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 = a * d
result = ac
if result < bc:
    result = bc
elif result < ad:
    result = ad
elif result < bd:
    result = bd
elif a < 0 and 0 < b and result < 0:
    result = 0
elif c < 0 and 0 < d and result < 0:
    result = 0
print(result)
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 * c
  else:
    ans = a * d
else:
  if yp:
    ans = b * c
  else:
    ans = b * d

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

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

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)
elif b > 0 and d <= 0:
    print(a * d)
# -*- coding: utf-8 -*-
a, b, c, d = map(int, input().split())
ans = max(a*c, b*d)
ans = max(ans, a*d)
ans = max(ans, b*d)
print(ans)
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))
elif int(a)>0 and int(c)>0:
  print(int(b)*int(d))
elif int(a)<0 and int(b)<0:
  print(int(b)*int(c))
elif int(c)<0 and int(d)<0:
  print(int(a)*int(d))
a,b,c,d = (int(x) for x in input().split())
if b and d >= 0:
    if a*c > b*d :
        print(a*c)
    else:
        print(b+d)
elif b and d < 0:
    print(a*c)
elif b >=0 and d < 0:
    if a*d > b*c :
        print(a*d)
    else:
        print(b*c)
elif b <0 and d >= 0:
    if a*d > b*c :
        print(a*d)
    else:
        print(b*c)
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:
        print(a*d)
if b*c >= b*d:
    print(b*c)
else:
    print(b*d)
a, b, c, d =map(int, input().split())

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

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

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


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

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

print(b*d)
a, b, c, d = input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
def m():
    if a<=b and c<=d:
        max=a*b+c*d
        print(max)
    else:
        print("plese press again")
m()
a,b,c,d=list(map(int, input("Enter a multiple value: ").split())) 
prod=[]

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

print(max(prod))
a,b,c,d = map(int,input().split())
if 0 <= a and 0 <= c:
    print(b*d)
elif 0 <= a and d <= 0:
    print(a*d)
elif b <= 0 and 0 <= c:
    print(b*c)
elif b <= 0 and d <= 0:
    print(a * c)
import sys
a,b,c,d=map(int,input().split())
if max(a,b)>=0 and max(c,d)>=0:
    print(max(a,b)*max(c,d))
    sys.exit()
elif max(a,b)<=0 and max(c,d)<=0:
    print(min(a,b)*min(c,d))
    sys.exit()
elif max(a,b)>=0 and max(c,d)<=0:
    print(min(a,b)*max(c,d))
    sys.exit()
elif max(a,b)<=0 and max(c,d)>=0:
    print(max(a,b)*min(c,d))
    sys.exit()
else:
    pass
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] = [int(inp) for inp in input().split()]
print(max([a * c, 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 and d < 0:
  print(a*c)
  
elif a > 0 and b > 0 and d < 0:
  print(a*d)
  
elif b < 0 and c > 0 and d > 0:
  print(b*c)

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

x_max = max(a, b)
x_min = min(a, b)

y_max = max(c, d)
y_min = min(c, d)

print(max(x_max * y_max, x_max * x_min, x_min * y_max, x_min * y_min))
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
a,b,c,d=get_ints()
x=max(a,b)
y=max(c,d)
print(x*y)
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 * a)
    else:
        print(b * c)

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

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

ans = 0

if ans < a*c:
    ans = a*c

if ans < a*d:
    ans = a*d

if ans < b*c:
    ans = b*c

if ans < b*d:
    ans = b*d

print(ans)
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])

print(a_1,a_2)
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)
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(1000000)
from collections import deque

# スペース区切りの整数の入力
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)
a,b,c,d=map(int,input().split())
print(max(a*c,b*d,a*d,b*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 * d)
    else:
        print(b * d)

elif b > 0 and d < 0:
    if a > 0:
        print(a * d)
    else:
        print(a * c)
a,b,c,d=map(int,input().split())
list1=[a,b]
list2=[c,d]
ans=-1*10**10
tmp=0
for i in list1:
    for j in list2:
        tmp=i*j
        if ans<tmp:
            ans=tmp
print(ans)
a,b,c,d = map(int, input().split())

if b < 0:
    if c > 0:
        print(b*c)
    else:
        print(a*c)
elif a < 0:
    if d < 0:
        print(a*c)
    elif c < 0:
        print(max(a*c,b*d))
    else:
        print(b*d)
else:
    if d < 0:
        print(b*c)
    else:
        print(b*d)
a,b,c,d = map(int,input().split())
ans = []
for i in c,d:
    ans.append(a*i)
for j in c,d:
    ans.append(b*i)

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


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

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

print(ans)
import numpy as np

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

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

print(max(a*b,c*d,b*c,a*d))
import sys
input = sys.stdin.readline

a,b,c,d = map(int,input().split())
if a >= 0 and c >= 0:
    print(b*d)
elif a >= 0 and c < 0 and d >= 0:
    print(b*d)
elif a >= 0 and c < 0 and d < 0:
    print(a*d)
elif a < 0 and c < 0:
    print(a*c)
elif a < 0 and b >= 0 and c >=0:
    print(b*d)
elif a < 0 and b < 0 and c >= 0:
    print(b * c)
a,b,c,d=map(int,input().split())
ac=a*c
ad=a*d
bc=b*c
bd=b*d
if max(ac,ad,bc,bd)<0:
    if a<0<b or c<0<d:
        print(0)
else:
    print(max(ac,ad,bc,bd))
a, b, c, d = [int(e) for e in input().split(" ")]
print(a, b, c, d)
if(0 <= a or 0 <= c):
    print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))
a, b, c, d = [int(e) for e in input().split(" ")]
#print(a, b, c, d)
if(0 <= a or 0 <= c):
    #print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    #print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    #print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    #print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))
a, b, c, d = map(int, input().split())

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

ans = -100000000000
tmp = 0
tmp = a*c
if ans < tmp:
    ans = tmp
tmp = a*d
if ans < tmp:
    ans = tmp
tmp = b*d
if ans < tmp:
    ans = tmp

tmp = b*c
if ans < tmp:
    ans = tmp
print(ans)
a,b,c,d = map(int, input().split())
if a >=0:
    if c > 0:
        print(b * d)
    elif d < 0:
        print(a * d)
    else:
        print(b*d)
else:
    if c > 0:
        print(b * c)
    elif d < 0:
        print(b * d)
    else:
        print(b * c)
a, b, c, d = [int(t) for t in input().split()]
print(max([b*d, a*c, a*d, b*d]))
def main():
    a,b,c,d=(int(x) for x in input().split())
    if b>0 and 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 d>=0:
    print(a*d)
elif b>=0 and d<=0:
"""
A=abs(a)
B=abs(b)
C=abs(c)
D=abs(d)

check_1 = a*c
check_2=a*d
check_3=b*c
check_4=b*d

if check_1<=check_2:
    check_1=check_2

if check_3<=check_4:
    check_3=check_4

if check_1<=check_3:
    print(check_1)
else:
    print(check_2)
a,b,c,d = map(int,input().split())
if b*c >= b*d:
    print(b*c)
elif a*d >= b*d:
    print(a*d)
elif a*c >= b*d:
    print(a*c)
else:
    print(b*d)
a,b,c,d = map(int,input().split())
e = a*c
f = a*d
g = b*c
h = b*d
xy =[e,f,g,h]
max(xy)
x = input()
x = [int(i) for i in x.split(" ")]
y = x[1] * x[3]
print(y)
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:
    d = c
    b = a
print(b * d)
arr = list(map(int,input().split()))

for i in range(2):
  for j in range(2,4):
    if i == 0:
      ans = arr[i]*arr[j]
    else:
      ans = max(ans, arr[i]*arr[j])
  
print(ans)
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*d)
lists = list(map(int,input().split()))
lists.sort()
a = lists[0]
b = lists[1]
c = lists[2]
d = lists[3]
e = a*b
f = c*d
if a*b>=c*d:
  print(a*b)
else:
  print(c*d)
a,b,c,d=input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)

z1 = a*b
z2 = a*c
z3 = b*c
z4 = b*d

l = [z1, z2, z3, z4]
max_value = max(l)
print(max_value)
a,b,c,d=map(int,input().split())
if b>0 and d>0:
    print(b*d)
elif b<=0 and d>0:
    print(c*b)
elif b>0 and d<=0:
    print(a*d)
else:
    print(a*c)
a,b,c,d=map(int,input().split())
print(min([a*c,a*d,b*c,b*d]))
a,b,c,d = map(int,input().split())
if 3*a*c > (a*d+b*c+b*d):
    print(a*c)
elif 3*a*d > (a*c+b*c+b*d):
    print(a*d)
elif 3*b*c > (a*c+a*d+b*d):
    print(b*c)
else:
    print(b*d)
[a,b,c,d] = list(map(int,input().split()))

if b>0 and d>0:
    out=b*d

elif b<=0 and d<=0:
    out=a*c

else:
    if b>=0 and d<0:
        if a<0:
            out=a*c
        else:
            out=a*d
    else:
        if c<0:
            out=a*c
        else:
            out=b*c

print(out)
import numpy as np
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]

mat = np.array([])
for i in [a,b]:
    for j in [c,d]:
        mat = np.append(mat, i*j)
print(int(np.max(mat)))
a,b,c,d=map(int,input().split())
if b<=0 and d<=0:
  print(a*c)
elif b<=0:
  print(b*c)
elif d<=0:
  print(d*a)
else:
  print(b*d)
a,b,c,d = map(int,input().split())

if b<0 and d<0:
    print(max(b*d,a*c))
elif b>=0 and d>=0:
    print(max(b*d,a*c))
else:
    print(max(b*c,a*d))
a,b,c,d=map(int,input().split())
List=[]
for i in range(a,b+1):
  for j in range(c,d+1):
    List.append(i*j)
max(List)
a, b, c, d = map(int, input().split())

a_b = [a, b]
c_d = [c, d]

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

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

print(max(x, y))
a=list(map(int,input().split()))

if a[0]>=0 and a[2]>=0:
  print(a[1]*a[3])

elif a[1]<=0 and a[3]<=0:
  print(a[0]*a[2])

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

elif a[0]>=0 and a[3]<=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[0]*a[3])
a, b, c, d = map(int,input().split())
print(max(a*b, b*c, c*d, a*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 b<=0 and c>=0:
  print(b*c)
elif a>=0 and d<=0:
  print(a*d)
L=list(map(int,input().split()))
# print(L)
ab=[L[0],L[1]]
cd=[L[2],L[3]]
ans=-(10**10)
for i in ab:
    for j in cd:
        ans=max(ans,i*j)
print(ans)
# B 
z = list(map(int, input().split(" ")))
maxnum = -1000000000
if z[0]*z[1] < 0 or z[2]*z[3] < 0:
    maxnum = 0
for i in range(2):
    for j in range(2):
        x = z[i]
        y = z[j+2]
    if maxnum < x*y:
        maxnum = x*y
print(maxnum)
a, b, c, d = [int(x) for x in input().split()]
print(abs(b * d))
A = list(map(int,input().split()))

maximum = -1*10**9
ifzero = 0
for i in range(2):
    for j in range(2,4):
        maximum = max(maximum,A[i]*A[j])

if (maximum<0):
    if (A[0]*A[1]<=0)|(A[2]*A[3]<=0):maximum=0
print(maximum)
a, b, c, d = map(int, input().split())

ans = -2e10
for x in [a, b, 0]:
    for y in [c,d, 0]:
        if x * y > ans:
            ans = x * y
print(ans)
a,b,c,d = map(int,input().split())

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

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

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