import scala.io.Source.stdin

object Main {
  def getMax(max:Int, min:Int, list:Iterator[Int]):Int = {
    if(list.hasNext) {
      val m = list.next()
      val (x:Int,y:Int) =
        if(max < m-min) {
          if(min > m) (m-min,m) else (m-min,min)
        }
        else {
          if(min>m) (max,m) else (max,min)
        }
      getMax(x, y, list)
    }
    else { max }
  }

  def main(args: Array[String]) = {
    val list = stdin.getLines().map { _.toInt }
    val n = list.next()
    val r0 = list.next()
    val r1 = list.next()
    val max = getMax(r1 - r0, if(r0 > r1) r1 else r0, list)

    println(max)
  }
}