Buggy python submission (verdict: Time Limit Exceeded):
import functools
import os
import sys
from functools import lru_cache


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        ret = fn(*args, **kwargs)
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        print(ret)
        return ret

    return wrapper


sys.setrecursionlimit(10000)
INF = float('inf')

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


# def xy(x, y, pos, x_turn):
#     if x_turn:
#         return A[pos], y
#     else:
#         return x, A[pos]
#
#
# @debug
# def solve(x, y, pos, x_turn):
#     if pos >= N:
#         return abs(x - y)
#
#     if x_turn:
#         ans = -INF
#         for i in range(pos, N):
#             x, y = xy(x, y, i, x_turn)
#             ans = max(ans, solve(x, y, i + 1, not x_turn))
#     else:
#         ans = INF
#         for i in range(pos, N):
#             x, y = xy(x, y, i, x_turn)
#             ans = min(ans, solve(x, y, i + 1, not x_turn))
#     return ans
#
# print(solve(Z, W, 0, True))


@lru_cache(maxsize=None)
def dpx(i):
    """
    i 番目から x が最善を尽くしたときのスコア
    :param i: 
    :return: 
    """
    if i == 0:
        y = W
    else:
        y = A[i - 1]

    ret = abs(A[-1] - y)
    for i in range(i + 1, N):
        ret = max(ret, dpy(i))
    return ret


@lru_cache(maxsize=None)
def dpy(i):
    """
    i 番目から y が最善を尽くしたときのスコア
    :param i: 
    :return: 
    """
    if i == 0:
        x = Z
    else:
        x = A[i - 1]

    ret = abs(A[-1] - x)
    for i in range(i + 1, N):
        ret = min(ret, dpx(i))
    return ret


print(dpx(0))


Fixed submission:
import functools
import os
import sys
import numpy as np


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        ret = fn(*args, **kwargs)
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        print(ret)
        return ret

    return wrapper


sys.setrecursionlimit(10000)
INF = float('inf')

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

# def xy(x, y, pos, x_turn):
#     if x_turn:
#         return A[pos], y
#     else:
#         return x, A[pos]
#
#
# @debug
# def solve(x, y, pos, x_turn):
#     if pos >= N:
#         return abs(x - y)
#
#     if x_turn:
#         ans = -INF
#         for i in range(pos, N):
#             x, y = xy(x, y, i, x_turn)
#             ans = max(ans, solve(x, y, i + 1, not x_turn))
#     else:
#         ans = INF
#         for i in range(pos, N):
#             x, y = xy(x, y, i, x_turn)
#             ans = min(ans, solve(x, y, i + 1, not x_turn))
#     return ans
#
# print(solve(Z, W, 0, True))


# @lru_cache(maxsize=None)
# def dpx(i):
#     """
#     i 番目から x が最善を尽くしたときのスコア
#     :param i:
#     :return:
#     """
#     if i == 0:
#         y = W
#     else:
#         y = A[i - 1]
#
#     ret = abs(A[-1] - y)
#     for i in range(i + 1, N):
#         ret = max(ret, dpy(i))
#     return ret
#
#
# @lru_cache(maxsize=None)
# def dpy(i):
#     """
#     i 番目から y が最善を尽くしたときのスコア
#     :param i:
#     :return:
#     """
#     if i == 0:
#         x = Z
#     else:
#         x = A[i - 1]
#
#     ret = abs(A[-1] - x)
#     for i in range(i + 1, N):
#         ret = min(ret, dpx(i))
#     return ret


# dpx[i]: i 番目以降から始めて x が最善を尽くしたときの最低スコア
dpx = np.empty(N + 1)
# dpy[i]: i 番目以降から始めて y が最善を尽くしたときの最高スコア
dpy = np.empty(N + 1)

dpx.fill(np.inf)
dpy.fill(-np.inf)
for i in reversed(range(1, N)):
    y = A[i - 1] if i > 0 else W
    dpx[i] = max(abs(A[-1] - A[i - 1]), dpy[i + 1])
    dpx[i] = min(dpx[i], dpx[i + 1])

    dpy[i] = min(abs(A[-1] - A[i - 1]), dpx[i + 1])
    dpy[i] = max(dpy[i], dpy[i + 1])

print(int(max(abs(A[-1] - W), dpy[1])))