#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int n, z, w;
  cin >> n >> z >> w;
  vector<int> in(n);
  for (int i = 0; i < n; i++) {
    cin >> in[i];
  }
  if (n == 1) {
    cout << abs(in[0] - w) << endl;
  } else {
    cout << max(abs(in[n - 1] - w), abs(in[n - 1] - in[n - 2])) << endl;
  }
  return 0;
}