Imports System
Imports System.Collections.Generic

Public Class Test
	Public Shared Sub Main()
        Dim s() As String
        Dim t() As String
        s = Split(Console.ReadLine())
        Dim n, z, w As Integer
        n = s(0)
        z = s(1)
        w = s(2)
        t = Split(Console.ReadLine())
        Dim a(n - 1) As Integer
        Dim b As New List(Of Integer)
        For i As Integer = 0 To n - 1
            a(i) = t(i)
            b.Add(a(i))
        Next i
        b.Add(z)
        b.Add(w)
        b.Sort()
        Console.WriteLine(Math.Max(Math.Abs(b(n + 1) - a(n - 1)), Math.Abs(b(0) - a(n - 1))))
	End Sub
End Class