main :: IO ()
main = do
  [n,z,w] <- map read.words <$> getLine :: IO [Int]
  as <- map read.words <$> getLine :: IO [Int]
  if length as > 1
    then
      let a_n = last as
          a_n_1 = (last.init) as
          diff0 = abs (w - a_n)
          diff1 = abs (a_n - a_n_1)
      in print $ maximum [diff0, diff1]
    else
      print $ abs (head as-w)
