#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 1e5 + 500;
const long long inf = 1e9 + 5;
pair<long long, long long> y[maxn];
long long pos[maxn];
long long lo, ro, n;
void update(long long l, long long r, long long val) {
  if (val == 0) {
    if (l == 0) {
      lo = max(lo, r - 1);
    } else {
      ro = min(ro, l);
    }
    if (lo >= ro) {
      lo = n - 1;
      ro = n;
    }
  } else {
    lo = min(lo, l - 1);
    ro = max(ro, r);
  }
}
bool finds(long long x) {
  if (x <= lo || ro <= x) {
    return 0;
  }
  return 1;
}
long long good(long long m) {
  lo = n;
  ro = 0;
  long long v = y[pos[n - 1]].first;
  long long l = lower_bound(y, y + n, make_pair(v - m, (long long)0)) - y;
  long long r =
      lower_bound(y, y + n, make_pair(v + m + 1, (long long)0)) - y - 1;
  update(l, r + 1, 1);
  for (long long i = n - 2; i >= 1; i--) {
    long long v = y[pos[i]].first;
    bool o = finds(pos[i]);
    long long l = lower_bound(y, y + n, make_pair(v - m, (long long)0)) - y;
    long long r =
        lower_bound(y, y + n, make_pair(v + m + 1, (long long)0)) - y - 1;
    update(0, l, 0);
    update(r + 1, n, 0);
    if (o) {
      update(l, r + 1, 1);
    }
  }
  return finds(pos[0]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  n += 2;
  for (long long i = 0; i < n; i++) {
    long long v;
    cin >> v;
    y[i] = make_pair(v, i);
  }
  sort(y, y + n);
  for (long long i = 0; i < n; i++) {
    pos[y[i].second] = i;
  }
  long long b = 0;
  long long e = inf;
  while (e - b > 1) {
    long long m = (e + b) / 2;
    if (good(m)) {
      e = m;
    } else {
      b = m;
    }
  }
  cout << e;
}
