#include <cstdio>
#include <cstdlib>
#include <algorithm>
#define rep(i,a) for(int i=0;i<(a);++i)

constexpr int MAX_N = 2000;

int N, Z, W;
int a[MAX_N];

int main()
{
  scanf( "%d%d%d", &N, &Z, &W );
  rep( i, N )
    scanf( "%d", a+i );

  printf( "%d\n", N==1?abs(a[N-1]-W):std::max( abs(a[N-1]-W), abs(a[N-2]-a[N-1]) ) );

  return 0;
}