#include <bits/stdc++.h>
#define LL long long
using namespace std;

const int maxn = 3000;
int A[maxn], n, a, b;

int main()
{
    scanf("%d%d%d", &n, &a, &b);
    for(int i = 0; i < n; i++)
        scanf("%d", &A[i]);
    if(n == 1)
        printf("%d\n", abs(A[0] - b));
    else
        printf("%d\n", max(abs(A[n - 1] - b), abs(A[n - 1] - A[n - 2])));
    return 0;
}
