#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n;
int x[MAXN];
struct _RMQ1 {
  int val[MAXN][20];
  void init(int a[], int n) {
    for (int i = 1; i <= n; i++) val[i][0] = a[i];
    for (int j = 1; (1 << j) <= n; j++)
      for (int i = 1; i + (1 << j) - 1 <= n; i++)
        val[i][j] = min(val[i][j - 1], val[i + (1 << (j - 1))][j - 1]);
  }
  int query(int l, int r) {
    int lgn = log2(r - l + 1);
    return min(val[l][lgn], val[r - (1 << lgn) + 1][lgn]);
  }
} RMQ1;
struct _RMQ2 {
  int val[MAXN][20];
  void init(int a[], int n) {
    for (int i = 1; i <= n; i++) val[i][0] = a[i];
    for (int j = 1; (1 << j) <= n; j++)
      for (int i = 1; i + (1 << j) - 1 <= n; i++)
        val[i][j] = max(val[i][j - 1], val[i + (1 << (j - 1))][j - 1]);
  }
  int query(int l, int r) {
    int lgn = log2(r - l + 1);
    return max(val[l][lgn], val[r - (1 << lgn) + 1][lgn]);
  }
} RMQ2;
bool Check(int val) {
  int maxv = 1;
  for (int i = 1; i <= n + 1; i++)
    if (i <= maxv && abs(x[i] - x[i - 1]) <= val) {
      if (x[i - 1] - val <= RMQ1.query(i, n + 1) &&
          RMQ2.query(i, n + 1) <= x[i - 1] + val)
        return true;
      int left = i, right = n, p = -1;
      while (left <= right) {
        int mid = (left + right) >> 1;
        if (x[i - 1] - val <= RMQ1.query(i, mid) &&
            RMQ2.query(i, mid) <= x[i - 1] + val) {
          p = mid;
          left = mid + 1;
        } else
          right = mid - 1;
      }
      maxv = max(maxv, p + 1);
    }
  return false;
}
int main() {
  scanf("%d%d%d", &n, &x[0], &x[1]);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i + 1]);
  RMQ1.init(x, n + 1);
  RMQ2.init(x, n + 1);
  int left = 0, right = 1e9, ans = -1;
  while (left <= right) {
    int mid = (left + right) >> 1;
    if (Check(mid)) {
      ans = mid;
      right = mid - 1;
    } else
      left = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
