import Control.Monad
import Data.List
main = do
  n <- readLn
  xys <- replicateM n $ map read . words <$> getLine
  let [xs,ys] = transpose $ map sort xys
  let zs = sort $ concat xys
  print $ ((maximum xs - minimum xs) * (maximum ys - minimum ys))
    `min` ((head zs - last zs) * (head (tail zs) - last (init zs)))