output_description: Print the minimum possible value.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      x_1 y_1
      x_2 y_2
      :
      x_N y_N
attempt: # coding: utf-8
  import array, bisect, collections, heapq, itertools, math, random, re, string, sys, time
  
  sys.setrecursionlimit(10**7)
  INF = 10**20
  MOD = 10**9 + 7
  
  
  def II():
      return int(input())
  
  
  def ILI():
      return list(map(int, input().split()))
  
  
  def IAI(LINE):
      return [ILI() for __ in range(LINE)]
  
  
  def IDI():
      return {key: value for key, value in ILI()}
  
  
  def solve(N, x, y):
      state = [x[0], x[0], y[0], y[0]]
      for i in range(1, N):
          state_1 = [
              max(state[0], x[i]),
              min(state[1], x[i]),
              max(state[2], y[i]),
              min(state[3], y[i]),
          ]
          state_2 = [
              max(state[0], y[i]),
              min(state[1], y[i]),
              max(state[2], x[i]),
              min(state[3], x[i]),
          ]
  
          dif_1 = (state_1[0] - state_1[1]) * (state_1[2] - state_1[3])
          dif_2 = (state_2[0] - state_2[1]) * (state_2[2] - state_2[3])
  
          if dif_1 > dif_2:
              state = state_2
          else:
              state = state_1
  
      ans = (state[0] - state[1]) * (state[2] - state[3])
      return ans
  
  
  def main():
      N = II()
      x, y = [], []
      for __ in range(N):
          a, b = ILI()
          x.append(a)
          y.append(b)
      print(solve(N, x, y))
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  There are N bags, each containing two white balls. The i-th box contains two
  balls with integers x_i and y_i written on them, respectively.
  
  For each of these bags, you will paint one of the balls red, and paint the
  other blue.
  
  Afterwards, the 2N balls will be classified according to color.
  
  Then, we will define the following:
  
    * R_{max}: the maximum integer written on a ball painted in red
    * R_{min}: the minimum integer written on a ball painted in red
    * B_{max}: the maximum integer written on a ball painted in blue
    * B_{min}: the minimum integer written on a ball painted in blue
  
  Find the minimum possible value of (R_{max} - R_{min}) \times (B_{max} -
  B_{min}).
samples: [{"input": "3\n    1 2\n    3 4\n    5 6", "output": "15\n    \n\nThe optimal solution is to paint the balls with x_1, x_2, y_3 red, and paint\nthe balls with y_1, y_2, x_3 blue.\n\n* * *"}, {"input": "3\n    1010 10\n    1000 1\n    20 1020", "output": "380\n    \n\n* * *"}, {"input": "2\n    1 1\n    1000000000 1000000000", "output": "999999998000000001"}]