#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 1e5 + 10;
int n, a[N];
bool f(int d) {
  int mn = INF, mx = -INF, ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    ans = 0;
    if (mx - a[i] <= d && a[i] - mn <= d) {
      mn = INF;
      mx = -INF;
      ans = 1;
    }
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  return ans;
}
int main() {
  cin >> n;
  n += 2;
  for (int i = 0; i < n; i++) cin >> a[i];
  a[n] = a[n - 1];
  int lo = -1, hi = INF;
  while (lo + 1 < hi) {
    int mi = (lo + hi) / 2;
    if (f(mi))
      hi = mi;
    else
      lo = mi;
  }
  cout << hi << endl;
  return 0;
}
