#include <stdio.h>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
	int n, z, w, a[2000];
	scanf("%d %d %d", &n, &z, &w);
	for (int i = 0; i < n; i++)
		scanf("%d", a + i);

	if (n != 1) {
		printf("%d\n", max(abs(w - a[n - 1]), abs(a[n - 1] - a[n - 2])));
	} else {
		printf("%d\n", abs(w - a[0]));
	}
}