# include <bits/stdc++.h>
using namespace std;

const int inf=0x3f3f3f3f;
const int maxn=2005;
typedef long long LL;
int n, z, w;
int data[maxn];

int main(){
    while(~scanf("%d%d%d", &n, &z, &w)){
        for(int i=1;i<=n;i++)scanf("%d", &data[i]);
        printf("%d\n", n==1?abs(w-data[1]):max(abs(w-data[n]), abs(data[n]-data[n-1])));
    }
    return 0;
}
