import java.util.*

fun main(args:Array<String>){
    val (n, z, w) = readLine()!!.split(" ").map{it.toInt()}
    val a = readLine()!!.split(" ").map{it.toInt()}
    val ans = if(n == 1) Math.abs(w - a.last()) else Math.max(Math.abs(w - a.last()), Math.abs(a[n - 2] - a[n - 1]))
    println(ans)
}
