import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.math;      // math functions

void main()
{
  auto rd = readln.split.to!(int[]), n = rd[0], z = rd[1], w = rd[2];
  auto a = readln.split.to!(int[]);

  auto dp1 = new int[](n); dp1[] = -1;
  auto dp2 = new int[](n); dp2[] = -1;
  writeln(max((w-a[$-1]).abs, calc1(z, w, a, 0, dp1, dp2)));
}

int calc1(int x, int y, int[] a, int i, int[] dp1, int[] dp2)
{
  if (i == a.length - 1) return (y-a[i]).abs;
  if (dp1[i] >= 0) return dp1[i];
  auto r = (y-a[$-1]).abs;
  foreach (int j, ai; a[i..$-1]) {
    r = max(r, (ai-a[$-1]).abs, calc2(ai, y, a, i+j+1, dp1, dp2));
  }
  return dp1[i] = r;
}

int calc2(int x, int y, int[] a, int i, int[] dp1, int[] dp2)
{
  if (i == a.length - 1) return (x-a[i]).abs;
  if (dp2[i] >= 0) return dp2[i];
  auto r = (x-a[$-1]).abs;
  foreach (int j, ai; a[i..$-1]) {
    r = min(r, (ai-a[$-1]).abs, calc1(x, ai, a, i+j+1, dp1, dp2));
  }
  return dp2[i] = r;
}
