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 2 1 1

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

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

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

a, b, c, d = list(map(int, input().split()))
s = a * c
t = a * d
u = b * c
v = b * d
print((max(s, t, u, v)))


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

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

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

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

from sys import stdin
a, b, c, d = [int(_) for _ in stdin.readline().rstrip().split()]
print(max([a*c, a*d, b*c, b*d]))

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

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

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

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*c,b*d))

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

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

resultnum = []
inputnum = input().split()

for tmp in range(2):
	resultnum.append(int(inputnum[tmp])*int(inputnum[2]))
	resultnum.append(int(inputnum[tmp])*int(inputnum[3]))

print(str(max(resultnum)))

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

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

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


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

x = [int(a), int(b)]
y = [int(c), int(d)]
nums = []

for i in range(len(x)):
  for j in range(len(y)):
    num = x[i]*y[j]
    nums.append(num)

max_num = max(nums)
print(max_num)

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

Max_ac = a*c
Max_ad = a*d
Max_bc = b*c
Max_bd = b*d

Max_list = [Max_ac,Max_ad,Max_bc,Max_bd] 
 
print((max(Max_list)))


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*c,b*d))

a=[int(x) for x in input().split()]
print(max([a[0]*a[2],a[0]*a[3],a[1]*a[2],a[1]*a[3]]))

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

all_prod = []

for x in [a, b]:
  for y in [c, d]:
    all_prod.append(x * y)

print((max(all_prod)))


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

nums = [Ans1, Ans2, Ans3, Ans4]
print(max(nums))

l=list(map(int,open(0).read().split()))
ans=[l[0]*l[2],l[0]*l[3],l[1]*l[2],l[1]*l[3]]
print(max(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());print(max(a*c,a*d,b*c,b*d))

def product_max(a,b,c,d):
    print(max(a*c, a*d, b*c, b*d))

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

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

a, b, c, d=map(int,input().split())
e=a*c
f=a*d
g=b*c
h=b*d

print(max(e,f,g,h))

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

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

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

ac = a*c
ad = a*d
bc = b*c
bd = b*d
ans = max([ac, ad, bc,bd])
print(ans)

for i in range(1):
    a,b,c,d = map(int,input().split())

result_1 = []
result_2 = []

if a <= b and c <= d:
    x = [a,b]
    
    y = [c,d]
    
    r1 = x[0]*y[0]
    r2 = x[0]*y[1]
    result_1.append(r1)
    result_1.append(r2)
    r3 = x[1]*y[0]
    r4 = x[1]*y[1]
    result_2.append(r3)
    result_2.append(r4)    
    
    x = max(result_1)
    y = max(result_2)
    result = max(x,y)

print(result)

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

if (a>0 and d<0)or(b<0 and c>0):
    print((min(abs(a),abs(b))*min(abs(c),abs(d)))*(-1))
else:
    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*c, b*d))

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*c,b*d))

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

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

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,b,c,d = map(int,input().split())
res = -float('inf')
for x in [a,b]:
  for y in [c,d]:
    res = max(x*y, res)
print(res)

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

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

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

ans = max(product_list)

print(ans)

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

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


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

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

print((max(li)))


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

temp = input().split(' ')
num_list = [int(s) for s in temp]
ans_list = []

for i in range(2):
    for j in range(2,4,1):
	    ans = num_list[i] * num_list[j]
	    ans_list.append(ans)
        
print(max(ans_list))

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

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

result_1 = []
result_2 = []

if a <= b and c <= d:
    x = [a,b]
    
    y = [c,d]
    
    r1 = x[0]*y[0]
    r2 = x[0]*y[1]
    result_1.append(r1)
    result_1.append(r2)
    r3 = x[1]*y[0]
    r4 = x[1]*y[1]
    result_2.append(r3)
    result_2.append(r4)    
    
    x = max(result_1)
    y = max(result_2)
    result = max(x,y)

print(result)

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


l = list(map(int, input().split()))
x_l, y_l = l[0:2], l[2:4]

max_result = float('-inf')

for x in x_l:
    for y in y_l:
        result = x * y
        if max_result < result:
            max_result = result
print(max_result)

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

#coding: utf-8
import math

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

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

print(result)

a,b,c,d=map(int, 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])))


import numpy as np

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

x = np.array([a,b])
y = np.array([c,d])

m = np.outer(x, y)
ret = np.max(m)
print(ret)

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

A,B,C,D = list(map(int,input().split()))
print(max(max(A,B)*max(C,D),min(A,B)*max(C,D),max(A,B)*min(C,D),min(A,B)*min(C,D)))

N=list(map(int,input().split()))
A=N[0]
B=N[1]
C=N[2]
D=N[3]
print(max(A*C,A*D,B*C,B*D))

import sys
a, b, c, d = sys.stdin.readline().strip().split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)
res_max = max(a * c, a * d, b * c, b * d)
print(res_max)

a, b, c, d=(int(x) for x in input().split())
ac = a * c
ad = a * d
bc = b * c
bd = b * d
q = [ac,ad,bc,bd]
high = q[0]
for value in q:
	if value > high:
		high = value
print(high)


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



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

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




x,y,z,w=map(int, input().split())
l=[]
l.append(x*z)
l.append(x*w)
l.append(y*z)
l.append(y*w)
print(max(l))

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

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

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


In = map(str,input().split())
In_list = list(In)
for i in range(len(In_list)):
    In_list[i] = int(In_list[i])
    
ac = In_list[0] * In_list[2]
ad = In_list[0] * In_list[3]
bc = In_list[1] * In_list[2]
bd = In_list[1] * In_list[3]

ans_list = [ac, ad, bc, bd]
ans_list.sort()
print(ans_list[3])

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

a,b,c,d = [int(s) for s in input().split()]
prods = [a * c, a * d, b * c, b * d]
m = max(prods)
print(m)

# -*- coding: utf-8 -*-
a,b,c,d=map(int,input().split())
k=[0]*4
k[0]=a*c
k[1]=a*d
k[2]=b*c
k[3]=b*d
m=sorted(k)
print(m[3])

from itertools import product


def answer(a: int, b: int, c: int, d: int) -> int:
    return max(x * y for x, y in product((a, b), (c, d)))


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


def __starting_point():
    main()
__starting_point()

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

print(max(a*c, b*c, a*d, 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 = [int(s) for s in input().split()]
print(max([a * c, a * d, b * c, b * d]))

a,b,c,d = [int(s) for s in input().split()]
prods = [a * c, a * d, b * c, b * d]
print(max(prods))

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

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

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

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

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

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

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


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

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

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*c, b*d))

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

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


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



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