Imports System

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
        For i As Integer = 0 To n - 1
            a(i) = t(i)
        Next i
  		If n=1 then
    		Console.Writeline(math.abs(a(0)-w))
		Else
  			Console.Writeline(Math.Max(Math.Abs(a(n-1)-w),Math.Abs(a(n-1)-a(n-2))))
		End if
        End Sub
End Class