program main
	implicit none
	integer :: N, Z, W
	integer, allocatable :: a(:)
	read(*, *) N, Z, W
	allocate(a(0:N))
	read(*, *) a(1:N)
	a(0) = W
	write(*, *) max(abs(a(N) - W), abs(a(N) - a(N-1)))
end program main