#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int mi[maxn << 2], mx[maxn << 2];
int a[maxn];
void up(int rt) {
  if (mx[rt << 1] >= mx[rt << 1 | 1])
    mx[rt] = mx[rt << 1];
  else
    mx[rt] = mx[rt << 1 | 1];
  if (mi[rt << 1] <= mi[rt << 1 | 1])
    mi[rt] = mi[rt << 1];
  else
    mi[rt] = mi[rt << 1 | 1];
  return;
}
void build(int rt, int l, int r) {
  if (l == r) {
    mi[rt] = mx[rt] = a[l];
    return;
  }
  build(rt << 1, l, ((l + r) >> 1));
  build(rt << 1 | 1, ((l + r) >> 1) + 1, r);
  up(rt);
}
int qry_down(int rt, int l, int r, int L, int R, int x, int op) {
  if (op == 0 && mi[rt] >= x) return -1;
  if (op == 1 && mx[rt] <= x) return -1;
  if (L <= l && r <= R) {
    if (l == r) return l;
    int res = qry_down(rt << 1, l, ((l + r) >> 1), L, R, x, op);
    if (res == -1)
      res = qry_down(rt << 1 | 1, ((l + r) >> 1) + 1, r, L, R, x, op);
    return res;
  }
  int res = -1;
  if (L <= ((l + r) >> 1))
    res = qry_down(rt << 1, l, ((l + r) >> 1), L, R, x, op);
  if (R > ((l + r) >> 1) && res == -1)
    res = qry_down(rt << 1 | 1, ((l + r) >> 1) + 1, r, L, R, x, op);
  return res;
}
int d[maxn];
int n;
bool check(int lim) {
  for (int i = (1); i < (n + 1); ++i) d[i] = 0;
  d[1] = 1;
  d[2] = -1;
  for (int i = (1); i < (n + 1); ++i) {
    d[i] += d[i - 1];
    if (d[i] == 0) continue;
    int p1 = qry_down(1, 1, n, i + 1, n, a[i] - lim, 0);
    if (p1 == -1) p1 = n + 1;
    int p2 = qry_down(1, 1, n, i + 1, n, a[i] + lim, 1);
    if (p2 == -1) p2 = n + 1;
    int p = min(p1, p2);
    if (p > i) d[i + 1]++, d[p]--;
  }
  return (d[n] != 0);
}
int sol() {
  build(1, 1, n);
  int l = abs(a[1] - a[2]), r = 1e9 + 7;
  int ans = 10086;
  while (l <= r) {
    if (check(((l + r) >> 1)))
      ans = ((l + r) >> 1), r = ((l + r) >> 1) - 1;
    else
      l = ((l + r) >> 1) + 1;
  }
  assert(ans != 10086);
  return ans;
}
int main() {
  cin >> n;
  cin >> a[1] >> a[2];
  n += 2;
  for (int i = (3); i < (n + 1); ++i) scanf("%d", &a[i]);
  int ans = sol();
  swap(a[1], a[2]);
  ans = min(ans, sol());
  cout << ans << endl;
  return 0;
}
