#include<bits/stdc++.h>
#define rep(i,a,n) for (int i = a;i < n;i++)
using namespace std;

int main() {
    int n, z, w,a[2001]; cin >> n >> z >> w;
    rep(i,1,n+1){
        cin >> a[i];
    }
    if (n == 1) {
        cout << abs(a[1] - w) << endl;
    } else {
        cout << max(abs(a[n] - w), abs(a[n - 1] - a[n])) << endl;
    }
}