import Data.List
import Debug.Trace

main = do
  [n,z,w] <- map read . words <$> getLine :: IO [Int]
  as <- map read . words <$> getLine :: IO [Int]
  print $ solve z w as

solve :: Int -> Int -> [Int] -> Int
solve z w (a:[]) =　abs(a-w)
solve z w as =
  result
  where
    look (a1:a2:[]) = (a1,a2)
    look (a:as) = look as
    (an_, an) = look as
    result = maximum [abs(an-w),abs(an-an_)]
