let () =
  Scanf.scanf "%d %d %d" @@ fun n _ w ->
  let a = Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  max (abs (a.(n-1) - w)) (if n <= 1 then 0 else abs (a.(n-2) - a.(n-1)))
  |> Printf.printf "%d\n"