#include <bits/stdc++.h>
using namespace std;
int n, a[110000];
set<int> Set;
set<int>::iterator it;
set<int>::reverse_iterator it2;
bool ok(int x) {
  Set.clear();
  Set.insert(a[0]);
  for (int i = 2; i < n; i++) {
    bool tt = !Set.empty();
    int cnt = 0;
    for (it = Set.begin(); it != Set.end(); it++) {
      if (abs(a[i] - (*it)) > x)
        cnt += 1;
      else
        break;
    }
    while (cnt--) {
      Set.erase(Set.begin());
    }
    cnt = 0;
    for (it2 = Set.rbegin(); it2 != Set.rend(); it2++) {
      if (abs(a[i] - *it2) > x)
        cnt += 1;
      else
        break;
    }
    while (cnt--) {
      Set.erase(*Set.rbegin());
    }
    if (abs(a[i] - a[i - 1]) <= x && tt) Set.insert(a[i - 1]);
  }
  return !Set.empty();
}
int main() {
  scanf("%d%d%d", &n, &a[0], &a[1]);
  n += 2;
  for (int i = 2; i < n; i++) scanf("%d", &a[i]);
  int l = abs(a[0] - a[1]) - 1, r = 2e9 + 1, mid;
  while (l < r - 1) {
    mid = (0LL + l + r) / 2;
    if (ok(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%d\n", r);
}
