#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0;
  bool ok = 0;
  char c = getchar();
  while (c < 48 || c > 57) ok |= (c == '-'), c = getchar();
  while (c > 47 && c < 58) x *= 10, x += c - 48, c = getchar();
  if (ok) x = -x;
  return x;
}
void print(int x) { printf("%d\n", x); }
int n, a, b, v[100002];
bool f(int x) {
  set<int> s;
  if (abs(v[0] - a) <= x) s.insert(a);
  if (abs(v[0] - b) <= x) s.insert(b);
  for (int i = 1; i < n; i++) {
    if (s.empty()) return 0;
    while (!s.empty()) {
      if (*s.rbegin() <= v[i] + x) break;
      s.erase(*s.rbegin());
    }
    while (!s.empty()) {
      if (*s.begin() >= v[i] - x) break;
      s.erase(*s.begin());
    }
    if (abs(v[i] - v[i - 1]) <= x) s.insert(v[i - 1]);
  }
  return (!s.empty());
}
int main() {
  n = read(), a = read(), b = read();
  if (a > b) swap(a, b);
  for (int i = 0; i < n; i++) v[i] = read();
  int hi = 1e9 + 1, lo = b - a - 1, mid;
  while (hi - lo > 1) {
    mid = (hi + lo) >> 1;
    if (f(mid))
      hi = mid;
    else
      lo = mid;
  }
  print(hi);
}
