#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;
typedef long long ll;

int N, Z, W;
ll in[2000];
ll ans;

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