import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

void main() {
    int n, z, w;
    scan(n, z, w);

    auto a = readln.split.to!(int[]);

    if (n == 1) {
        writeln(abs(a[0] - w));
        return;
    }

    if (abs(a[n - 1] - w) > abs(a[n - 1] - a[n - 2])) {
        writeln(abs(a[n - 1] - w));
    }
    else {
        writeln(abs(a[n - 1] - a[n - 2]));
    }
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}