//written by libra9z
#include <bits/stdc++.h>
using namespace std;
long long n,z,w,a[2005],ans,b[2005];
int main()
{
	cin>>n>>z>>w;
	for (int i=0;i<n;++i)
	{
		cin>>a[i];
	}
    if (n==1)
	{
        ans=abs(a[0]-w);
        cout<<ans<<endl;
        return 0;
    }
    for (int i=0;i<n;++i) b[i]=abs(a[i]-a[n-1]);
    ans=max(abs(a[n-1]-w),b[n-2]);
    cout<<ans<<endl;
	return 0;
}