import scala.io.StdIn._

object Main extends App {
  val n = readInt()
  val a = readLine().split(" ").map(_.toInt).toSeq

  def maxDiff(list: Seq[Int], max: Int): Int = {
    if (list.length > 2) {
      val i = (0 until list.length - 1).maxBy(i => (list(0) - list(i + 1)).abs)
      maxDiff(list.tail, math.max((list(0) - list(i + 1)).abs, max))
    } else
      math.max((list(0) - list(1)).abs, max)
  }

  println(maxDiff(a, 0))
}
