object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, _ = sc.nextInt()
  val a = Array.fill(n)(sc.nextInt())
  val last = sc.nextInt()
  val dp = Array.fill(n, 2)(0)

  for (i <- n-1 to 0 by -1) {
    val ai = a(i)
    val s = (ai - last).abs
    dp(i)(0) = s.max(dp.drop(i+1).map(_(1)).maxOption.getOrElse(0))
    dp(i)(1) = s.min(dp.drop(i+1).map(_(0)).minOption.getOrElse(Int.MaxValue))
  }

  println(dp(0)(0))
}
