
object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)

    // input
    val N = sc.nextInt
    val Z = sc.nextInt
    val W = sc.nextInt
    val a = for(i <- 1 to N) yield sc.nextInt

    //output
    if (N == 1){
      println(Math.abs(a(0)-W))
    }else{
      println(Math.max(Math.abs(a(0)-W), Math.abs(a(N-2)-a(N-1))))
    }
  }
}
