#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;

int main(){
    int N,Z,W;
    cin >> N >> Z >> W;
    int a[N];
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    if(N==1) cout << abs(W-a[N-1]) << endl;
    else cout << max(abs(W-a[N-1]),abs(a[N-2]-a[N-1])) << endl;
    return 0;
}