import sys

input = sys.stdin.readline

from collections import *

sys.setrecursionlimit(2100)



def rec(sta, t):

    if memo[sta][t]!=-1:

        return memo[sta][t]

    

    if t==0:

        res = -10**18

        

        for i in range(sta, N):

            if i<N-1:

                res = max(res, rec(i+1, 1))

            else:

                if sta==0:

                    res = max(res, abs(a[N-1]-W))

                else:

                    res = max(res, abs(a[N-1]-a[sta-1]))

    else:

        res = 10**18

        

        for i in range(sta, N):

            if i<N-1:

                res = min(res, rec(i+1, 0))

            else:

                if sta==0:

                    res = min(res, abs(a[N-1]-Z))

                else:

                    res = min(res, abs(a[N-1]-a[sta-1]))

    

    memo[sta][t] = res

    

    return res



N, Z, W = list(map(int, input().split()))

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

memo = [[-1]*2 for _ in range(N)]

print((rec(0, 0)))
import sys

input = sys.stdin.readline



N, Z, W = list(map(int, input().split()))

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

dp = [[0]*(2) for _ in range(N)]



for i in range(N-1, -1, -1):

    if i==0:

        dp[i][0] = abs(a[N-1]-W)

    else:

        dp[i][0] = abs(a[N-1]-a[i-1])

    

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

        dp[i][0] = max(dp[i][0], dp[j][1])

    

    if i==0:

        dp[i][1] = abs(a[N-1]-Z)

    else:

        dp[i][1] = abs(a[N-1]-a[i-1])

    

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

        dp[i][1] = min(dp[i][1], dp[j][0])



print((dp[0][0]))
import sys

input = sys.stdin.readline
from collections import *

sys.setrecursionlimit(2100)


def rec(sta, t):
    if memo[sta][t] != -1:
        return memo[sta][t]
    if t == 0:
        res = -(10**18)
        for i in range(sta, N):
            if i < N - 1:
                res = max(res, rec(i + 1, 1))
            else:
                if sta == 0:
                    res = max(res, abs(a[N - 1] - W))
                else:
                    res = max(res, abs(a[N - 1] - a[sta - 1]))
    else:
        res = 10**18
        for i in range(sta, N):
            if i < N - 1:
                res = min(res, rec(i + 1, 0))
            else:
                if sta == 0:
                    res = min(res, abs(a[N - 1] - Z))
                else:
                    res = min(res, abs(a[N - 1] - a[sta - 1]))
    memo[sta][t] = res
    return res


N, Z, W = list(map(int, input().split()))
a = list(map(int, input().split()))
memo = [[-1] * 2 for _ in range(N)]
print((rec(0, 0)))

import sys

input = sys.stdin.readline
N, Z, W = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [[0] * (2) for _ in range(N)]
for i in range(N - 1, -1, -1):
    if i == 0:
        dp[i][0] = abs(a[N - 1] - W)
    else:
        dp[i][0] = abs(a[N - 1] - a[i - 1])
    for j in range(i + 1, N):
        dp[i][0] = max(dp[i][0], dp[j][1])
    if i == 0:
        dp[i][1] = abs(a[N - 1] - Z)
    else:
        dp[i][1] = abs(a[N - 1] - a[i - 1])
    for j in range(i + 1, N):
        dp[i][1] = min(dp[i][1], dp[j][0])
print((dp[0][0]))

-from collections import * - -sys.setrecursionlimit(2100) - - -def rec(sta, t): -    if memo[sta][t] != -1: -        return memo[sta][t] -    if t == 0: -        res = -(10**18) -        for i in range(sta, N): -            if i < N - 1: -                res = max(res, rec(i + 1, 1)) -            else: -                if sta == 0: -                    res = max(res, abs(a[N - 1] - W)) -                else: -                    res = max(res, abs(a[N - 1] - a[sta - 1])) -    else: -        res = 10**18 -        for i in range(sta, N): -            if i < N - 1: -                res = min(res, rec(i + 1, 0)) -            else: -                if sta == 0: -                    res = min(res, abs(a[N - 1] - Z)) -                else: -                    res = min(res, abs(a[N - 1] - a[sta - 1])) -    memo[sta][t] = res -    return res - - -memo = [[-1] * 2 for _ in range(N)] -print((rec(0, 0))) +dp = [[0] * (2) for _ in range(N)] +for i in range(N - 1, -1, -1): +    if i == 0: +        dp[i][0] = abs(a[N - 1] - W) +    else: +        dp[i][0] = abs(a[N - 1] - a[i - 1]) +    for j in range(i + 1, N): +        dp[i][0] = max(dp[i][0], dp[j][1]) +    if i == 0: +        dp[i][1] = abs(a[N - 1] - Z) +    else: +        dp[i][1] = abs(a[N - 1] - a[i - 1]) +    for j in range(i + 1, N): +        dp[i][1] = min(dp[i][1], dp[j][0]) +print((dp[0][0]))