peterverebics/CodeNet_Python_118 huggingface dataset:
import sys


def main():
    a, b, c, d = map(int, sys.stdin.readline().rstrip().split())

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

    if (a <= 0 and 0 <= b) or (c <= 0 and 0 <= d):
        print(max(ac, bc, ad, bd, 0))
    else:
        print(max(ac, bc, ad, bd))


main()
import sys
#sys.exit()
#sorted( ,reverse=True)

a,b,c,d = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]
#print(a,b,c,d)
#cnt = 0
#cnt += 1

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

#print(N)
#print(S,T)
#print(A)
#print('Yes')
#print('No')
#print(cnt)
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)
a,b,c,d = list(map(int,input().split()))

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

print(max(AC,AD,BC,BD))
x_low,x_up,y_low,y_up=map(int,input().split())

a1=x_low*y_low
a2=x_low*y_up
a3=x_up*y_low
a4=x_up*y_up

ans=max(a1,a2,a3,a4)
print(ans)
[a,b,c,d] = list(map(int,input().split()))

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

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

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

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

print(max(a*c, b*d, a*d, b*c))
import sys
r=sys.stdin.readline
a,b,c,d=map(int,r().split())
print(max([a*c,a*d,b*c,b*d]))
L=list(map(int,input().split()))
a=L[0]
b=L[1]
c=L[2]
d=L[3]
print(max(a*c,b*d,a*d,b*c))
nums = [int(i) for i in input().split()]
a = nums[0]
b = nums[1]
c = nums[2]
d = nums[3]
ac = a*c
bd = b*d
if (ac<=0 and bd<=0):
  max = max(a*d, b*c)
elif (ac>=0 and bd>=0):
  max = max(ac, bd)
elif ac>=0:
  max = ac
elif bd>=0:
  max = bd
  
print(max)
a, b, c, d = map(int, input().split())
if a < 0 and c < 0:
    if a*c > b*d:
        print(a*c)
    else:
        print(b*d)
elif a > 0 and c < 0:
    if a*d > b*d:
        print(a*d)
    else:
        print(b*d)
elif a < 0 and c > 0:
    if b*c > b*d:
        print(b*c)
    else:
        print(b*d)
else:
    print(b*d)
a, b, c, d = map(int, input().split())
print(max(a * c, b * d, a * d, b * c))
a,b,c,d=map(int,input().split())

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

tmp=max(abcd)

if tmp>=0:
    print(tmp)
else:
    if a<=0 and 0<=b:
        print(0)
    elif c<=0 and 0<=d:
        print(0)
    else:
        print(tmp)
A,B,C,D=input().split(' ')
a,b,c,d=int(A),int(B),int(C),int(D)

print(max(a*c,a*d,b*c,b*d))
a, b, c, d = map(int, input().split())
t = [a * c, a * d, b * c, b * d]
print(max(t))
a,b,c,d = map(int,input().split())
X = [a, b]
Y = [c, d]
m = [x * y for x in X for y in Y]
print(max(m))
a, b, c, d = map(int, input().split())

import itertools

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

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

x = [a,b]
y = [c,d]
ans = [i * j for i in x for j in y]
print( max(ans) )
# -*- coding: utf-8 -*-

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

max_a = max(a*c,a*d)
max_b = max(b*c,b*d)
print(max(max_a,max_b))
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
p=a*c
q=a*d
r=b*c
s=b*d
print(max(p,q,r,s))
a,b, c, d = [int(x) for x in input().split()]
print( max(a * c, a * d, b * c,b *d))
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)
a,b,c,d = [int(x) for x in input().split()]
t = [a*c,a*d,b*c,b*d]
print(max(t))
a, b, c, d = map(int, input().split())

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

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

l1 = [a,b]
l2 = [c,d]

if(a<0 and 0<b):
    l1.append(0)
if(c<0 and 0<d):
    l2.append(0)

l = []
for x in l1:
    for y in l2:
        l.append(x*y)

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

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

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

print(ans)
a,b,c,d=(int(i) for i in input().split())
print(max(a*c,a*d,b*c,b*d))
a,b,c,d = list(map(int,input().split()))
print(max(a*c,a*d,b*c,b*d))
a, b, c, d = map(int,input().split())
x = a * c
y = a * d
z = b * c
u = b * d
ans = max(x, y, z, u)
print(ans)
a, b, c, d = map(int, input().split())

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

print(max(a*c, b*c, a*d, b*d))
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a, b, c, d = LI()
ans = max(a*c, b*d, a*d, b*c)
print(ans)
a, b, c, d = map(int, open(0).read().split())
print(max(a*c,a*d,b*c,b*d))
a, b, c, d=map(int, input().split())
a1 = a*c
a2 = a*d
a3 = b*c
a4 = b*d
ans = max(a1, a2, a3, a4)
print(ans)
a,b,c,d=map(int,input().split())
ans=-10**18
for num1 in [a,b]:
    for num2 in [c,d]:
        ans=max(ans,num1*num2)
print(ans)
a,b,c,d = map(int,input().split())
ans = b * d
for i in a,b:
    for j in c,d:
        ans = max(i*j,ans)
print(ans)
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))
x = list(map(int, input().split()))
print(max([x[0]*x[2],x[0]*x[3],x[1]*x[2],x[1]*x[3]]))
li = list(map(int, input().split()))
ans = []
for i in range(2):
    for j in range(2,4):
        ans.append(li[i]*li[j])
print(max(ans))
a,b,c,d=map(int,input().split())
if a>-1 and b<1:
  print(max(a*c,a*d,b*c,b*d,0))
elif c>-1 and d<1:
  print(max(a*c,a*d,b*c,b*d,0))
else:
  print(max(a*c,a*d,b*c,b*d))
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)
a,b,c,d=map(int,input().split())
if a>=0 and c>=0:
    Ans=b*d
elif b<0 and d<0:
    Ans=a*c
elif a>=0:
    if d<0:
        Ans=a*d
    else:
        Ans=b*d
elif c>=0:
    if b<0:
        Ans=b*c
    else:
        Ans=b*d
else:
    if b>0 and d>0:
        Ans=max([a*c,b*d])
    else:
        Ans=a*c
print(Ans)
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b* d))
a, b, c, d = map(int, input().split())

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

print(max([ac, bc, ad, bd]))
(a, b, c, d) = [int(x) for x in input().split(' ')]
print(max([a*c, b*c, a*d, 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(a*c,a*d,b*c,b*d))
def main():
    a, b, c, d = map(int, input().split())
    conds = [a*c, a*d, b*c, b*d]
    print(max(conds))
    
 
if __name__ == '__main__':
    main()
a,b,c,d = map(int, input().split())

mx=max(a*c,a*d,b*c,b*d)
print(mx)
def solve():
  a,b,c,d = list(map(int, input().split()))
  
  ret = max(a*c, b*d, a*d, b*c)
  print(ret)
  
solve()
details = input()
details = details.split()
first = details[:2]
second = details[2:]
checker = []
for numbers in first:
    for dig in second:
        checker.append(int(numbers) * int(dig))
print(max(checker))
# coding: utf-8
a, b, c, d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
s=input().split()
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])
m=[]
m.append(a*c)
m.append(a*d)
m.append(b*c)
m.append(b*d)
print(max(m))
a, b, c, d = map(int, input().split())
ans = max(a*c, b*d, a*d, b*c)
print(ans)
a, b, c, d = map(int, input().split())
print(
  max(a*c, a*d, b*c, b*d)
)
import itertools

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

num = None
for x, y in itertools.product([a, b], [c, d]):
  if num == None:
    num = x * y
  else:
    num = max(num, x * y)

print(num)
a, b, c, d = map(int,input().split())
e1 = a*c
e2 = a*d
e3 = b*c
e4 = b*d

list = [e1, e2, e3, e4]
list.sort()

print(list[3])
a,b,c,d=map(int, input().split())
print(max(a*c,a*d,b*c,b*d))
a, b, c, d = map(int, input().split())
net = []
net.append(a * c)
net.append(a * d)
net.append(b * c)
net.append(b * d)
print(max(net))
a,b,c,d = map(int, input().split())
m = a*c
n = a*d
o = b*c
p = b*d
if(m>n and m>o and m>p):
    print(m)
elif (n>m and n>o and n>p):
    print(n)
elif (o> m and o>n and o>p):
    print(o)
else:
    print(p)
a,b,c,d=[int(x) for x in input().split(' ')]
print(max([a*c,a*d,b*c,b*d]))
a,b,c,d=map(int,input().split())
ab=list([a,b])
cd=list([c,d])
ans=ab[0]*cd[0]
for i in range(len(ab)):
    for j in range(len(cd)):
        temp=ab[i]*cd[j]
        ans=max(ans,temp)
print(ans)
A,B,C,D = map(int, input().split())

a1 = A * C
a2 = A * D
a3 = B * C
a4 = B * D

list = (a1,a2,a3,a4)

print(max(list))
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))
# author:  Taichicchi
# created: 13.09.2020 21:00:30

import sys

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

ans = max(a * d, a * c, b * c, b * d)
print(ans)
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

a,b,c,d = (int(x) for x in input().split())
print(max([a*c,a*d,b*c,b*d]))
a, b, c, d = map(int, input().split())
x = [a * c, a * d, b * c, b * d]
print(max(x))
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 )
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

a,b,c,d=map(int,input().split())
ans=-10**18
#x=0 or y=0
if a<=0<=b or c<=0<=d:
    ans=max(ans,0)
#x<0 and y>0
ans=max(ans,b*c)
#x>0 and y>0
ans=max(ans,b*d)
#x<0 and y<0
ans=max(ans,a*c)
#x>0 and y<0
ans=max(ans,a*d)
print(ans)
a, b, c, d = map(int, input().split())
x = a * c
y = a * d
z = b * c
w = b * d
xy = max(x,y)
zw = max(z, w)
print(max(xy, zw))
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


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

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

max_a = max(ac, ad)
max_b = max(bc, bd)

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

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

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

print (max(anslist))
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = None

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

print(ans)
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

a,b,c,d = inm()
print(max([a*c,a*d,b*c,b*d]))
a,b,c,d=map(int,input().split())
ans1=a*c
ans2=a*d
ans3=b*c
ans4=b*d
print(max(max(max(ans1,ans2),ans3),ans4))
def main():
    mx = (10 ** 21) * (-1)
    a,b,c,d = map(int,input().split())
    for x in (a,b):
        for y in (c,d):
            mx = max(mx,x*y)
    print(mx)

main()
a,b,c,d = map(int,input().split())
k = max(a*c,b*d)
l = max(a*d,b*c)
print(max(k,l))
a, b, c, d = map(int, input().split())
ary = [a * c, a * d, b * c, b * d]
print(max(ary))
a,b,c,d=map(int,input().split(" "))
print(max([a*c,a*d,b*c,b*d]))
import sys

input = sys.stdin.readline


def main():
    a, b, c, d = map(int, input().split())
    p = b * d
    q = a * c
    r = a * d
    s = b * c
    print(max(p, q, r, s))


if __name__ == '__main__':
    main()
a,b,c,d=map(int,input().split());print(max(a*c,a*d,b*c,b*d))
def main():
   a,b,c,d=map(int,input().split())
   p1=a*c
   p2=a*d
   p3=b*c
   p4=b*d
   x=max(p1,p2)
   y=max(p3,p4)
   print(max(x,y))

main()
# 178B
a,b,c,d = list(map(int, input().split()))
e = a*c
f = a*d
g = b*c
h = b*d
ans=[e,f,g,h]
print(max(ans))
a, b, c, d = [int(x) for x in input().split()]


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

s=[]

s.append(a*c)
s.append(a*d)
s.append(b*c)
s.append(b*d)
if (a<=0 and b>=0) or (c<=0 and d>=0):
  s.append(0)
s.sort()

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

lst = [a*c, a*d, b*c, b*d]
print(max(lst))
a,b,c,d=map(int,input().split())
L=[a*c,a*d,b*c,b*d]
print(max(L))
a, b, c, d = list(map(int, input().split(' ')))
mul = [a*c, a*d, b*c, b*d]
print(max(mul))
a, b, c, d = map(int, input().split())

ans_l = [a*c, a*d, b*c, b*d]
print(max(ans_l))
import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

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


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

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

print(max(l))
a, b, c, d = map(int, input().split())
l = []
for x in (a, b):
    for y in (c, d):
        l.append(x*y)
print(max(l))
import collections
import fractions
import itertools
import functools
import bisect
import heapq
import math

def solve():
    a, b, c, d = map(int, input().split())
    ans = [
        a*c,
        a*d,
        b*c,
        b*d
    ]
    print(max(ans))
    return 0

if __name__ == "__main__":
    solve()
a, b, c, d = list(map(int, input().split()))
ac = a * c
ad = a * d
bc = b * c
bd = b * d
print(max(ac,ad,bc,bd))
a, b , c ,d = map(int,input().split(' '))
one = a*c
two = a*d
three = b*c
four = b*d
line = [one, two, three, four]
print(max(line))
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)
S = max(lis)
print(S)
a,b,c,d = map(int,input().split())

A = [0]*4
A[0] = a*c
A[1] = a*d
A[2] = b*c
A[3] = b*d
print(max(A))
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)
def main():
   a, b, c, d = map(int, input().split())
   res = max(a*c, a*d, b*c, b*d)
   print(res)

if __name__ == "__main__":
    main()
a, b, c, d = map(int, input().split())
x = a * c
y = a * d
z = b * c
u = b * d
print(max([x, y, z, u]))
a,b,c,d = map(int, input().split())
aa = [a,b]
bb = [c,d]
pri = []

for i in aa:
  for j in bb:
    pri.append(i*j)
    
print(max(pri))
a,b,c,d = map(int,input().split())

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

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

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

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


main()
read = lambda: list(map(int, input().split()))

a, b, c, d = read()

p = a * c
q = a * d
r = b * c
s = b * d
print(max(p, q, r, s))
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))


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

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

print(max(x, y, z, w))
a,b,c,d = map(int,input().split())
print(max(a*c, b*d, a*d, b*c))
import sys

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

a,b,c,d = [int(i) for i in input().split()]
ans = max(a*c,a*d,b*c,b*d)
print(ans)
A,B,C,D=map(int, input().split())

print(max(A*C,A*D,B*C,B*D))
a,b,c,d=map(int,input().split())
x=[]*4
x.append(a*c)
x.append(b*c)
x.append(a*d)
x.append(b*d)
x.sort()
print(x[-1])
a, b, c, d = map(int, input().split())

ms = [a*c, a*d, b*c, b*d]
#print('# ms:', ms)

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

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

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

hantei = [ac, ad, bc, bd]

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

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

print(max(l))
a,b,c,d = map(int,input().split())
print(max(a*c , a*d , b * c , b*d))
def main():
    a, b, c, d = [int(e) for e in input().split()]

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


if __name__ == '__main__':
    main()
a,b,c,d=map(int,input().split())
print(max(a*c,d*b,b*c,a*d))
a,b,c,d = map(int,input().split())


print(max(a*c,a*d,b*c,b*d))
#!/usr/bin/env python3
# coding:utf-8

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


"""
方針


"""


def solve(a, b, c, d):
    ac = a * c
    ad = a * d
    bc = b * c
    bd = b * d
    l = [ac, ad, bc, bd]
    m = max(l)
    return m


if __name__ == "__main__":
    main()
a,b,c,d=map(int, input().split())
ans=a*c
ifans=a*d
if(ifans>ans):
    ans=ifans
ifans=b*c
if(ifans>ans):
    ans=ifans
ifans=b*d
if(ifans>ans):
    ans=ifans
print(ans)
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)
a,b,c,d = map(int,input().split())
prod1 = a*c
prod2 = a*d
prod3 = b*c
prod4 = b*d
print(max(prod1,prod2,prod3,prod4))
A, B, C, D = [int(x) for x in input().split()]
print(max(A * C, A * D, B * C, B * D))
a,b,c,d=map(int,input().split())

q=a*c
w=a*d
e=b*c
r=b*d

ans=max(q,w,e,r)
print(ans)
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)
a, b, c, d = map(int, input().split())
L = [a*c, a*d, b*c, b*d]
ans = max(L)
print(ans)
a = list(map(int, input().split()))
x = a[:2]
y = a[2:]
num = []
for i in x:
  for j in y:
    num.append(i * j)
    
  
print(max(num))
a, b, c, d = map(int, input().split())
l = []
l.append(a * c)
l.append(a * d)
l.append(b * c)
l.append(b * d)
print(max(l))
a, b, c, d = [int(x) for x in input().split()]

print(max(a*d, a*c, b*d, b*c))
a,b,c,d=map(int,input().split()) 
x = max(a*c,b*d,a*d,b*c)
print(x)
def solve():
    a,b,c,d=[int(v) for v in input().split()]
    print(max(a*c, a*d, b*c, b*d))

t = 1 #int(input())
for _ in range(t):
    solve()
a, b, c, d = [int(t) for t in input().split()]
print(max([b*d, a*c, a*d, b*c]))
a, b, c, d= map(int,input().split())
print(max(a * c, a * d, b * c, b * d))
a, b, c, d = map(int,input().split())
print(max(a*d,b*c,b*d,a*c))
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)
a, b, c, d = map(int, input().split())

answer = max(a*c, a*d, b*c, b*d)
print(answer)
a,b,c,d = map(int,input().split(" "))
print(max([a*c,a*d,b*c,b*d]))
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)
a, b, c, d = list(map(int, input().split()))
 
print(max(a*c,a*d,b*c,b*d))
# input
a, b, c, d = map(int, input().split())

# process
ans = -10**18
t = a*c
if ans < t:
    ans = t
t = a*d
if ans < t:
    ans = t
t = b*c
if ans < t:
    ans = t
t = b*d
if ans < t:
    ans = t

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

ans_candi = []

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

print(max(ans_candi))
a,b,c,d=map(int,input().split())
x=-10**18
for i in [a,b]:
  for j in [c,d]:
    if i*j>x:
      x=i*j
print(x)
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())

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
    elif a > 0 and d > 0:
        ans = b * d
    elif c > 0 and b > 0:
        ans = d * b

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

if b>0 and d>0:

    one=b
    two=c
elif b>=0 and d>=0:

    one=a
    two=c
else:
    if b>0:

        one=a
        two=d
    else:

        one=b
        two=c

print(one*two)
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(a * c)
    else:
        print(a * c)
a = [int(x) for x in input().split()]
print(max(a[0]*a[2],a[1]*a[3]))
a,b,c,d = map(int, input().split())
x = a
y = c
max = x * y
if b <= 0:
  print(max)
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*c >= b*d:
    print(a*c)
elif a*d >= b*d:
    print(a*d)
elif b*c >= b*d:
    print(b*c)
else:
    print(b*d)
a,b,c,d = map(int,input().split())
print(max(a*c,b*d,a*d))
a, b, c, d = map(int, input().split())
L = [a*b, a*c, a*d, b*c, b*d, c*d]
print(max(L))
a, b, c, d = map(int, input().split())

x=0
y=0
if b < 0:
  x=b
else:
  x=a

if d < 0:
  y=d
else:
  y=c

print(x*y)
a,b,c,d=map(int,input().split())
if 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(b*d)
else:
  print(b*d)
def resolve():
    a, b, c, d = list(map(int, input().split()))

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

    for x in (a, b):
        for y in (c, d):
            ans = max(ans, x * y)
    if (b == 0 and d > 0) or (b > 0 and d == 0):
        ans = 0

    print(ans)

resolve()
import sys
from itertools import combinations
input = sys.stdin.readline

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

li = list(combinations(h,2))
answer = -10000000001
for i in li:
    answer = max(answer,i[0]*i[1])
print(answer)