{-# LANGUAGE BangPatterns #-}
import Control.Arrow
import Control.Applicative
import Control.Monad.Fix
import Control.Monad.ST
import Data.Int
import Data.Foldable
import Data.List
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Debug.Trace

solve :: Int -> Int -> Int -> VU.Vector Int -> Int
solve !n !z !w !an = maximum
  [ minimum $ map (abs . (an VU.! x -))
                  [ if y == n then w else an VU.! y | y <- [x + 1 .. n] ]
  | x <- [0 .. n - 1]
  ]

main = do
  let readInt :: Integral a => B.ByteString -> Maybe (a, B.ByteString)
      readInt = fmap (first fromIntegral . second B.tail) . B.readInt

  (n, z, w) <-
    (\vec -> (vec VU.! 0, vec VU.! 1, vec VU.! 2))
    .   VU.unfoldrN 3 readInt
    <$> B.getLine
  an <- VU.unfoldrN n readInt <$> B.getLine
  print $ solve n z w an
