#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long sum = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) f |= (c == '-'), c = getchar();
  while (isdigit(c)) sum = (sum << 1) + (sum << 3) + (c ^ 48), c = getchar();
  return f ? -sum : sum;
}
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
const int N = 100010;
int A, B, n, a[N], ans;
int rt, cnt, ls[N << 4], rs[N << 4], val[N << 4], tag[N << 4], Lm = -2e9,
                                                               Rm = 2e9;
inline void push_up(int node) { val[node] = val[ls[node]] + val[rs[node]]; }
inline void push_down(int node) {
  if (tag[node])
    tag[ls[node]] = tag[rs[node]] = 1, val[ls[node]] = val[rs[node]] = 0,
    tag[node] = 0;
}
void update(int &node, int start, int end, int id) {
  if (!node) node = ++cnt;
  if (start == end) return void(val[node] = 1);
  int mid = (start + end) >> 1;
  push_down(node);
  if (id <= mid)
    update(ls[node], start, mid, id);
  else
    update(rs[node], mid + 1, end, id);
  push_up(node);
}
void clear(int node, int start, int end, int L, int R) {
  if (!node) return;
  if (start >= L && end <= R) {
    tag[node] = 1, val[node] = 0;
    return;
  }
  push_down(node);
  int mid = (start + end) >> 1;
  if (L <= mid) clear(ls[node], start, mid, L, R);
  if (R > mid) clear(rs[node], mid + 1, end, L, R);
  push_up(node);
}
int query(int node, int start, int end, int L, int R) {
  if (!node) return 0;
  if (start >= L && end <= R) return val[node];
  if (start > R || end < L) return 0;
  push_down(node);
  int mid = (start + end) >> 1;
  return query(ls[node], start, mid, L, R) +
         query(rs[node], mid + 1, end, L, R);
}
inline bool check(int mid) {
  memset(tag, 0, (cnt + 1) * sizeof(int)),
      memset(val, 0, (cnt + 1) * sizeof(int));
  memset(ls, 0, (cnt + 1) * sizeof(int)),
      memset(rs, 0, (cnt + 1) * sizeof(int));
  rt = cnt = 0;
  int x1 = A, x2 = B;
  update(rt, Lm, Rm, x1), update(rt, Lm, Rm, x2);
  for (register int i = (1); i <= (n); i++) {
    clear(rt, Lm, Rm, Lm, a[i] - mid - 1);
    clear(rt, Lm, Rm, a[i] + mid + 1, Rm);
    if (query(rt, Lm, Rm, Lm, Rm) == 0) return false;
    update(rt, Lm, Rm, a[i]);
  }
  return true;
}
signed main() {
  n = read(), A = read(), B = read();
  for (register int i = (1); i <= (n); i++) a[i] = read();
  int l = abs(A - B), r = 1e9;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << r << endl;
}
