import Control.Applicative ((<$>)) main :: IO () main = do n <- readLn solve n <$> map read <$> words <$> getLine >>= mapM_ print solve :: Int -> [Int] -> [Int] solve n xs = let mn = minimum $ zipWith (-) (tail xs) xs mx = xs !! (n-1) - xs !! 0 in [mn, mx]