#include <bits/stdc++.h> 
using namespace std; 
typedef long long ll;

int main(){
	ll N,Z,W;
	cin >> N >> Z >> W;
	vector<ll> a(N);
	for(auto &x:a){
		cin >> x;
	}
	if(N==1){
		cout << abs(W-a[0]) << endl;
		return 0;
	}
	ll ans = max(abs(a[N-2]-a[N-1]),abs(W-a[N-1]));
	cout << ans << endl;
}