import Data.List (sort) main = do getLine as <- map read . words <$> getLine mapM print $ solve as solve as = [amin, amax] where amin = head $ sort $ zipWith (-) (tail as) (init as) amax = last as - head as