#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
int n, x[N];
set<int> s;
bool check(int l) {
  if (abs(x[1] - x[2]) > l) return 0;
  s.clear();
  s.insert(x[1]);
  for (int i = 3; i <= n; i++) {
    if (s.empty()) {
      return 0;
    }
    s.insert(x[i - 1]);
    while (!s.empty() && abs(x[i] - *s.begin()) > l) s.erase(*s.begin());
    while (!s.empty() && abs(x[i] - *s.rbegin()) > l) s.erase(*s.rbegin());
  }
  return !s.empty();
}
int main() {
  scanf("%d", &n);
  n += 2;
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  int l = 0, r = 1000000000, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
