main :: IO ()
main = do
  [n, z, w] <- getInts
  as <- getInts
  let an = as !! (n - 1)
      an' = as !! (n - 2)
  print $ solve an an' w
  
getInts :: IO [Int]
getInts = map read . words <$> getLine

solve an an1 w = max (abs (an - w)) (abs (an - an1))
