import java.lang.Math
import kotlin.comparisons.*

val MOD: Int = 1000000000 + 7
val MODL: Long = MOD.toLong()

fun main(args: Array<String>)
{
    val (n, z, w) = read().split().toInt()
    val a = read().split().toInt()
    if (n >= 2) {
        val score1 = Math.abs(w - a[n-1])
        val score2 = Math.abs(a[n-2] - a[n-1])

        println(Math.max(score1, score2))
    } else {
        println(Math.abs(w - a[0]))
    }

}

fun read(): String = readLine()!!
fun CharSequence.split(): List<String> = this.split(" ")
fun Iterable<String>.toInt(): List<Int> = this.map{it.toInt()}
