// Arup Guha
// 5/11/2016
// Solution to USACO 2016 Bronze April Problem: Field Reduction

import java.util.*;
import java.io.*;

public class reduce {

	public static void main(String[] args) throws Exception {

		// Read in data.
		BufferedReader stdin = new BufferedReader(new FileReader("reduce.in"));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		int n = Integer.parseInt(tok.nextToken());

        // I get lazier every day, finding ways to avoid writing a comparator...
        pt[] pts = new pt[n];
        pt[] flipPts = new pt[n];
        for (int i=0; i<n; i++) {
            tok = new StringTokenizer(stdin.readLine());
            int x = Integer.parseInt(tok.nextToken());
            int y = Integer.parseInt(tok.nextToken());
            pts[i] = new pt(x,y);
            flipPts[i] = new pt(y,x);
        }

		// Sort the data.
		Arrays.sort(pts);
		Arrays.sort(flipPts);

        // Only 4 pts that might make a difference...
        int res = area(pts, 0);
        res = Math.min(res, area(pts, n-1));
        res = Math.min(res, area(flipPts, 0));
        res = Math.min(res, area(flipPts, n-1));

		// Write result.
		PrintWriter out = new PrintWriter(new FileWriter("reduce.out"));
		out.println(res);
		out.close();
		stdin.close();
	}

    // Returns the area enclosing pts excluding pt pts[exclude].
	public static int area(pt[] pts, int exclude) {

        int minX = 100000, maxX = 0;
        int minY = 100000, maxY = 0;

        // Go through all pts but the excluded one.
        for (int i=0; i<pts.length; i++) {
            if (i == exclude) continue;
            minX = Math.min(minX, pts[i].x);
            maxX = Math.max(maxX, pts[i].x);
            minY = Math.min(minY, pts[i].y);
            maxY = Math.max(maxY, pts[i].y);
        }

        // Here is our box.
        return (maxX-minX)*(maxY-minY);
	}
}

class pt implements Comparable<pt> {

    public int x;
    public int y;

    public pt(int myx, int myy) {
        x = myx;
        y = myy;
    }

    public int compareTo(pt other) {
        return this.x - other.x;
    }
}
