import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=readln.splitter;foreach(ref v;t){v=r.front.to!T;r.popFront;}}

void main()
{
  int n, z, w; readV(n, z, w);
  int[] a; readA(n, a);

  if (n == 1)
    writeln((a[$-1]-w).abs);
  else
    writeln(max((a[$-1]-w).abs, (a[$-2]-a[$-1]).abs));
}
