import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

input=lambda :sys.stdin.readline().rstrip()

def resolve():

    n,z,w=list(map(int,input().split()))

    A=list(map(int,input().split()))

    dp=[[None]*2 for _ in range(n+1)] # dp[i][turn] 消費枚数i,turnの手から始まるときの最適解



    def dfs(i,turn):

        if(dp[i][turn] is not None): return



        # i+1からn-1のdp[1-turn]を埋めておく(i=n-1のときterminate)

        for j in range(i+1,n):

            dfs(j,1-turn)



        res=-INF if(turn==0) else INF

        if(turn==0):

            for j in range(i+1,n):

                res=max(res,dp[j][1])

            y=A[i-1] if(i!=0) else w

            res=max(res,abs(A[-1]-y))

        else:

            for j in range(i+1,n):

                res=min(res,dp[j][0])

            x=A[i-1] if(i!=0) else z # x=zとなることは無い

            res=min(res,abs(A[-1]-x))

        dp[i][turn]=res



    dfs(0,0)

    print((dp[0][0]))

resolve()
import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

input=lambda :sys.stdin.readline().rstrip()

def resolve():

    n,z,w=list(map(int,input().split()))

    A=list(map(int,input().split()))

    dp=[[None]*2 for _ in range(n+1)] # dp[i][turn] 消費枚数i,turnの手から始まるときの最適解



    def dfs(i,turn)->NoneType:

        if(dp[i][turn] is not None): return



        # i+1からn-1のdp[1-turn]を埋めておく(i=n-1のときterminate)

        for j in range(i+1,n):

            dfs(j,1-turn)



        res=-INF if(turn==0) else INF

        if(turn==0):

            for j in range(i+1,n):

                res=max(res,dp[j][1])

            y=A[i-1] if(i!=0) else w

            res=max(res,abs(A[-1]-y))

        else:

            for j in range(i+1,n):

                res=min(res,dp[j][0])

            x=A[i-1]

            res=min(res,abs(A[-1]-x))

        dp[i][turn]=res



    dfs(0,0)

    print((dp[0][0]))

resolve()
import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()


def resolve():
    n, z, w = list(map(int, input().split()))
    A = list(map(int, input().split()))
    dp = [[None] * 2 for _ in range(n + 1)]  # dp[i][turn] 消費枚数i,turnの手から始まるときの最適解

    def dfs(i, turn):
        if dp[i][turn] is not None:
            return
        # i+1からn-1のdp[1-turn]を埋めておく(i=n-1のときterminate)
        for j in range(i + 1, n):
            dfs(j, 1 - turn)
        res = -INF if (turn == 0) else INF
        if turn == 0:
            for j in range(i + 1, n):
                res = max(res, dp[j][1])
            y = A[i - 1] if (i != 0) else w
            res = max(res, abs(A[-1] - y))
        else:
            for j in range(i + 1, n):
                res = min(res, dp[j][0])
            x = A[i - 1] if (i != 0) else z  # x=zとなることは無い
            res = min(res, abs(A[-1] - x))
        dp[i][turn] = res

    dfs(0, 0)
    print((dp[0][0]))


resolve()

import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()


def resolve():
    n, z, w = list(map(int, input().split()))
    A = list(map(int, input().split()))
    dp = [[None] * 2 for _ in range(n + 1)]  # dp[i][turn] 消費枚数i,turnの手から始まるときの最適解

    def dfs(i, turn) -> NoneType:
        if dp[i][turn] is not None:
            return
        # i+1からn-1のdp[1-turn]を埋めておく(i=n-1のときterminate)
        for j in range(i + 1, n):
            dfs(j, 1 - turn)
        res = -INF if (turn == 0) else INF
        if turn == 0:
            for j in range(i + 1, n):
                res = max(res, dp[j][1])
            y = A[i - 1] if (i != 0) else w
            res = max(res, abs(A[-1] - y))
        else:
            for j in range(i + 1, n):
                res = min(res, dp[j][0])
            x = A[i - 1]
            res = min(res, abs(A[-1] - x))
        dp[i][turn] = res

    dfs(0, 0)
    print((dp[0][0]))


resolve()

-    def dfs(i, turn): +    def dfs(i, turn) -> NoneType: -            x = A[i - 1] if (i != 0) else z  # x=zとなることは無い +            x = A[i - 1]