#include <bits/stdc++.h>

using namespace std;

int n, x, y, ar[1000001];


int main()
{
    cin >> n >> x >> y;

    for(int i = 1; i <= n; i++)
        cin >> ar[i];

    int ans = 0;
    ans = max(abs (ar[n] - y), ans);
    if(n > 1)
        ans = max(abs (ar[n - 1] - ar[n]), ans);
    if(n > 2)
        ans = max(min(abs(ar[n - 2] - ar[n]), abs(ar[n - 1] - ar[n])), ans);

    cout << ans << endl;
    return 0;
}
