import Data.List

main :: IO ()
main = do
    [_,z,w] <- fmap read . words <$> getLine :: IO [Int]
    ls <- fmap read . words <$> getLine :: IO [Int]
    print $ solve ls z w

solve :: [Int] -> Int -> Int -> Int
solve ls z w    | length ls == 1 = abs (w - head ls)
                | otherwise = max (maximum $ abs <$> [w - head ls',w - ls' !! 1]) ot where
                    ls' = reverse ls
                    lss = takeWhile (== (maximum ls)) (reverse ls)
                    ot = if (lss /= []) && (last ls == maximum lss) then abs $ (maximum ls) - last ls else 0