program main
  implicit none
  integer :: n, z, w, i, res1, res2
  integer, allocatable :: a(:)

  read(*, *) n, z, w
  allocate(a(n))

  read(*, *) (a(i), i = 1, n)

  if (n == 1) then
    res1 = 0
  else
    res1 = abs(a(n - 1) - a(n))
  end if
  res2 = abs(a(n) - w)

  write(*, "(i0)"), max(res1, res2)

  deallocate(a)
  contains
end
