main :: IO ()
main = interact $ unlines . map show . solve . map read . tail . words

f :: [Int] -> [Int]
f []       = []
f [x]      = [x]
f (x:y:ys) = (y - x) : f (y:ys)

solve :: [Int] -> [Int]
solve xs = [mi, ma]
    where
        mi = minimum $ f xs
        ma = last xs - head xs