import Control.Monad
import Control.Applicative
import Data.List
import Data.Array
import Data.Array.IO
import Data.Maybe
import Data.Bits
import Data.Ord
import qualified Data.ByteString.Char8 as BS
import qualified Data.Set as Set
import Debug.Trace
import Numeric

modifyArray arr i f = readArray arr i >>= \x -> writeArray arr i (f x)

listToTuple2 [a,b] = (a,b)
listToTuple3 [a,b,c] = (a,b,c)
listToTuple4 [a,b,c,d] = (a,b,c,d)

getWords = getLine >>= return . words

readIntBS = fst . fromJust . BS.readInt

main :: IO ()
main = do

  (n,z,w) <- listToTuple3 . map readIntBS . BS.words <$>  BS.getLine :: IO (Int,Int,Int)
  as <- map readIntBS . BS.words <$> BS.getLine :: IO [Int]

  print $ if n == 1 then abs (w - last as) else max (abs $ w - last as) (abs $ last as - (last $ init as))

