fun main(arg: Array<String>) {
    val (N, Z, W) = listOfInt()
    val A = listOfInt()
    val ans =
        if (N == 1) Math.abs(A[0] - W)
        else Math.max(Math.abs(A[N - 1] - W), Math.abs(A[N - 2] - A[N - 1]))
    println(ans)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfInt(d: Int = 0) = listOfString().map { Integer.parseInt(it) + d }
fun listOfLong() = listOfString().map(String::toLong)
