#include <bits/stdc++.h>
using namespace std;
int n, A, B;
int tmp[100100];
int s[100100];
void find(int& l, int& r) {
  l = lower_bound(tmp + 1, tmp + n + 3, l) - tmp;
  r = upper_bound(tmp + 1, tmp + n + 3, r) - tmp - 1;
}
int T[400100];
void update(int root) {
  T[root] = T[root << 1] | T[root << 1 | 1];
  return;
}
int lazy[400100];
void pushdown(int root) {
  if (!lazy[root]) return;
  lazy[root << 1] = 1;
  lazy[root << 1 | 1] = 1;
  T[root << 1] = 0;
  T[root << 1 | 1] = 0;
  lazy[root] = 0;
  return;
}
void change(int root, int l, int r, int x) {
  if (l == r) {
    T[root] = 1;
    return;
  }
  pushdown(root);
  int mid = (l + r) >> 1;
  if (x <= mid)
    change(root << 1, l, mid, x);
  else
    change(root << 1 | 1, mid + 1, r, x);
  update(root);
  return;
}
void clear(int root, int l, int r, int x, int y) {
  if (x > y) return;
  if (x <= l && r <= y) {
    T[root] = 0;
    lazy[root] = 1;
    return;
  }
  pushdown(root);
  int mid = (l + r) >> 1;
  if (x <= mid) clear(root << 1, l, mid, x, y);
  if (y > mid) clear(root << 1 | 1, mid + 1, r, x, y);
  update(root);
  return;
}
int query(int root, int l, int r, int x, int y) {
  if (x > y) return 0;
  if (x <= l && r <= y) return T[root];
  pushdown(root);
  int mid = (l + r) >> 1, ans = 0;
  if (x <= mid) ans |= query(root << 1, l, mid, x, y);
  if (y > mid) ans |= query(root << 1 | 1, mid + 1, r, x, y);
  return ans;
}
void build(int root, int l, int r) {
  T[root] = 0;
  lazy[root] = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(root << 1, l, mid);
  build(root << 1 | 1, mid + 1, r);
  return;
}
int getpos(int x) { return lower_bound(tmp + 1, tmp + n + 3, x) - tmp; }
bool check(int mid) {
  if (abs(A - B) > mid) return false;
  int N = n + 2;
  build(1, 1, N);
  s[0] = A;
  change(1, 1, N, getpos(B));
  for (int i = 1; i <= n; i++) {
    int val = 0;
    if (abs(s[i] - s[i - 1]) <= mid) val = query(1, 1, N, 1, N);
    int L = s[i] - mid, R = s[i] + mid;
    find(L, R);
    clear(1, 1, N, 1, L - 1);
    clear(1, 1, N, R + 1, N);
    if (val) change(1, 1, N, getpos(s[i - 1]));
  }
  return query(1, 1, N, 1, N);
}
int main() {
  scanf("%d %d %d", &n, &A, &B);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i]);
    tmp[i] = s[i];
  }
  tmp[n + 1] = A;
  tmp[n + 2] = B;
  sort(tmp + 1, tmp + n + 3);
  int l = -1, r = 1e9;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%d\n", r);
  return 0;
}
