#include<bits/stdc++.h>
using namespace std;
const int N=2105;
int n,x,y,a[N];
int main()
{
	scanf("%d%d%d",&n,&x,&y);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	if(n==1){printf("%d\n",abs(a[1]-y)); return 0;}
	int ans=max(abs(a[n]-y),abs(a[n-1]-a[n]));
	printf("%d\n",ans);
	return 0;
}