#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int i,N;
long long Z,W;
cin >> N >> Z >> W;
vector<long long> a(N);
for(i=0;i<N;i++){
cin >> a[i];
}
	if(N==1){
		cout << abs(a[N-1]-W) << endl;
	}else {
		cout << max(abs(a[N-1]-a[N-2]),abs(W-a[N-1])) << endl;
}
}