combinations :: Int -> [Int] -> [[Int]]
combinations n xs = comb n (length xs) xs where
  comb 0 _ _ = [[]]
  comb r n a@(x:xs)
    | n == r    = [a]
    | otherwise = map (x:) (comb (r - 1) (n - 1) xs) ++ comb r (n - 1) xs
main = do
 n <- read <$> getLine :: IO Int
 print =<< maximum . (map (\[x,y] -> x * y)) . (combinations 2) . map read . words <$> getLine