#include <cstdio>
#include <algorithm>
using namespace std;
int n, z, w, a[2002];
int main() {
    scanf("%d %d %d", &n, &z, &w);
    for (int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
    }
    if (n == 1) {
        printf("%d", abs(a[1]-w));
        return 0;
    }
    printf("%d", max(abs(a[n]-w), abs(a[n]-a[n-1])));
    return 0;
}