#include <bits/stdc++.h>
using namespace std;
int a[(100005)];
int s1, s2, n;
bool check(int d) {
  int l = a[n - 1] - d;
  int r = a[n - 1] + d;
  for (int i = n - 2; i >= 0; --i) {
    if (l <= a[i] && a[i] <= r)
      l = a[i] - d, r = a[i] + d;
    else
      l = max(l, a[i] - d), r = min(r, a[i] + d);
    if (l > r) return false;
  }
  return (l <= s1 && s1 <= r) || (l <= s2 && s2 <= r);
}
int main() {
  scanf("%d %d %d", &n, &s1, &s2);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  int l = abs(s1 - s2);
  int r = 1e9;
  while (l < r) {
    int m = (l + r) >> 1;
    if (check(m))
      r = m;
    else
      l = m + 1;
  }
  printf("%d\n", l);
  return 0;
}
