#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main(){
    int n, z, w, c;
    cin >> n >> z >> w;
    vector<int> a;
    for(int i=0; i<n; i++){
        cin >> c;
        a.push_back(c);
    }
    if(n == 1){
        cout << int(abs(w-a[n-1])) << endl;
    }
    else{
        cout << int(max(abs(a[n-2]-a[n-1]), abs(w-a[n-1]))) << endl;
    }
}