#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int maxn = 100010;
int laz[maxn * 4], c[maxn * 4];
void build(int idx, int u, int v) {
  laz[idx] = c[idx] = 0;
  if (u == v) {
    return;
  }
  int m = u + (v - u) / 2;
  build(idx * 2, u, m);
  build(idx * 2 + 1, m + 1, v);
}
int xx, yy;
void down(int idx) {
  if (laz[idx]) {
    laz[idx * 2] = laz[idx * 2 + 1] = 1;
    c[idx * 2] = c[idx * 2 + 1] = 0;
    laz[idx] = 0;
  }
}
void E(int idx, int u, int v) {
  if (xx <= u && v <= yy) {
    laz[idx] = 1;
    c[idx] = 0;
    return;
  }
  down(idx);
  int m = u + (v - u) / 2;
  if (xx <= m) {
    E(idx * 2, u, m);
  }
  if (yy > m) {
    E(idx * 2 + 1, m + 1, v);
  }
  c[idx] = c[idx * 2] + c[idx * 2 + 1];
}
void A(int idx, int u, int v) {
  if (xx == u && xx == v) {
    c[idx]++;
    return;
  }
  down(idx);
  int m = u + (v - u) / 2;
  if (xx <= m) {
    A(idx * 2, u, m);
  } else {
    A(idx * 2 + 1, m + 1, v);
  }
  c[idx] = c[idx * 2] + c[idx * 2 + 1];
}
int x[maxn], r[maxn];
bool ok(int d, int n) {
  int m = n + 2;
  build(1, 1, m);
  xx = lower_bound(r, r + m, x[n + 1]) - r + 1;
  A(1, 1, m);
  for (int i = 1; i <= n; ++i) {
    if (x[i] - d > r[0]) {
      xx = 1;
      yy = lower_bound(r, r + m, x[i] - d) - r + 1 - 1;
      E(1, 1, m);
    }
    if (x[i] + d < r[n + 1]) {
      yy = m;
      xx = upper_bound(r, r + m, x[i] + d) - r + 1;
      E(1, 1, m);
    }
    if (abs(x[i] - x[i - 1]) <= d) {
      xx = lower_bound(r, r + m, x[i - 1]) - r + 1;
      A(1, 1, m);
    }
    if (c[1] == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  cin >> x[0] >> x[n + 1];
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x[i]);
  }
  for (int i = 0; i <= n + 1; ++i) {
    r[i] = x[i];
  }
  sort(r, r + n + 2);
  int u = abs(x[0] - x[n + 1]), v = 1e9;
  while (v > u) {
    int m = u + (v - u) / 2;
    if (ok(m, n)) {
      v = m;
    } else {
      u = m + 1;
    }
  }
  cout << v << endl;
  return 0;
}
