import
    std.algorithm,
    std.array,
    std.conv,
    std.functional,
    std.stdio,
    std.string;

void main()
{
    auto b = readln.chomp.split.to!(int[]);
    auto arr = readln.chomp.split.to!(int[]);
    solve(b[1], b[2], arr).writeln;
}

int[] cards;
int _solveX(in int y, in size_t p)
{
    int answer = abd(y, cards[$-1]);
    foreach (i; 1..p)
        answer = solveY(cards[$-i-1], i).max(answer);
    return answer;
}
int _solveY(in int x, in size_t p)
{
    int answer = abd(x, cards[$-1]);
    foreach (i; 1..p)
        answer = solveX(cards[$-i-1], i).min(answer);
    return answer;
}
alias solveX = memoize!_solveX;
alias solveY = memoize!_solveY;
auto solve(in int x, in int y, int[] a)
{
    cards = a;
    return solveX(y, a.length);
}
auto abd(in int x, in int y)
{
    return x < y ? y - x : x - y;
}
