#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  ll n, z, w;
  cin >> n >> z >> w;

  ll a[n];
  for(int i=0; i<n; i++){
    cin >> a[i];
  }

  if(n == 1){
    cout << abs(a[0]-w) << endl;
  }
  else{
    cout << max(abs(a[n-1]-w), abs(a[n-1]-a[n-2])) << endl;
  }

  return 0;
}
