object Main extends App {
	import scala.math._

	val NZW = scala.io.StdIn.readLine.split(" ").map(_.toLong)
	val A = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	val N = NZW(0).toInt

	if(N == 1){
		println((A(N-1)-NZW(2)).abs)
	}else{
		val a = (NZW(2) - A(N-1)).abs
		val b = (A(N-1) - A(N-2)).abs

		println(max(a,b))

	}
	

}