import Data.List

main = print . solve . map read . drop 1 . words =<< getContents

solve :: [Integer] -> Integer
solve xs =
    let diffs = zipWith (-) (drop 1 xs) xs
    in  minimum . map (abs . sum) . drop 1 . subsequences $ diffs
