import Data.List f ::[Int]->[Int] f (x:[])=[] f (x:y:xs)=(y-x):f (y:xs) main = do e<-getLine es<-getLine let as=map read (words es)::[Int] bs=sort as putStrLn $ show $ minimum (f bs) putStrLn $ show $ maximum(bs)-minimum(bs)