#include <cstdio>

int arr[2001];
int n, z, w;

int abs(int x){
	return x>0?x:-x;
}
int max(int a, int b){
	return a>b?a:b;
}

int main(){
	scanf("%d %d %d", &n, &z, &w);
	for(int i=1; i<=n; i++)
		scanf("%d", &arr[i]);
	if(n == 1)
		printf("%d\n", abs(w-arr[n]));
	else
		printf("%d\n", max(abs(w-arr[n]), abs(arr[n-1]-arr[n])));
}
