#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define maxn 100005
using namespace std;
typedef long long ll;
int n;
ll x,y;
ll a[maxn];
ll myabs(ll now)
{
	return now>0 ? now : -now;
}
int main()
{
	scanf("%d%lld%lld",&n,&x,&y);
	for(int i=1;i<=n;i++)
		scanf("%lld",&a[i]);

	ll maxx=myabs(a[n]-y);
	if(n>1)
		maxx=max(maxx,myabs(a[n]-a[n-1]));
	printf("%lld\n",maxx);
}
