object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val z = sc.nextInt
    val w = sc.nextInt
    val an = List.fill(n)(sc.nextInt)

    val ans = if (an.length == 1) {
      Math.abs(an.head - w)
    } else {
      val a = Math.abs(an.last - w)
      val b = Math.abs(an.last - an(an.length - 2))
      if (a > b) a else b
    }

    println(ans)
  }
}
