# include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL a[2003];
int main()
{
    int n;
    LL z, w;
    scanf("%d%lld%lld",&n,&z,&w);
    for(int i=1; i<=n; ++i) scanf("%d",&a[i]);
    if(n == 1) printf("%lld\n",llabs(a[1]-w));
    else
        printf("%lld\n",max(llabs(a[n-1]-a[n]), llabs(a[n]-w)));
    return 0;
}
