import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc sc.close() sc.close sc long abMin = Math.min(a,b); abMin Math.min(a,b) Math.min Math a b long abMax = Math.max(a,b); abMax Math.max(a,b) Math.max Math a b long cdMin = Math.min(c,d); cdMin Math.min(c,d) Math.min Math c d long cdMax = Math.max(c,d); cdMax Math.max(c,d) Math.max Math c d long[] tmpAns = new long[4]; tmpAns new long[4] 4 tmpAns[0] = abMin * cdMin tmpAns[0] tmpAns 0 abMin * cdMin abMin cdMin tmpAns[1] = abMin * cdMax tmpAns[1] tmpAns 1 abMin * cdMax abMin cdMax tmpAns[2] = abMax * cdMin tmpAns[2] tmpAns 2 abMax * cdMin abMax cdMin tmpAns[3] = abMax * cdMax tmpAns[3] tmpAns 3 abMax * cdMax abMax cdMax Arrays.sort(tmpAns) Arrays.sort Arrays tmpAns System.out.println(tmpAns[3]) System.out.println System.out System System.out tmpAns[3] tmpAns 3 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();

        long abMin = Math.min(a,b);
        long abMax = Math.max(a,b);
        long cdMin = Math.min(c,d);
        long cdMax = Math.max(c,d);

        long[] tmpAns = new long[4];
        tmpAns[0] = abMin * cdMin;
        tmpAns[1] = abMin * cdMax;
        tmpAns[2] = abMax * cdMin;
        tmpAns[3] = abMax * cdMax;

        Arrays.sort(tmpAns);

        System.out.println(tmpAns[3]);
    }
}
