#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, s1, s2;
int a[N];
int l, r;
int check(int x) {
  int l = a[n] - x, r = a[n] + x;
  for (int i(n - 1); i >= (1); --i) {
    if (a[i] >= l && a[i] <= r)
      l = a[i] - x, r = a[i] + x;
    else {
      l = max(l, a[i] - x);
      r = min(r, a[i] + x);
    }
  }
  return (s1 >= l && s1 <= r) || (s2 >= l && s2 <= r);
}
int main() {
  scanf("%d%d%d", &n, &s1, &s2);
  for (int i(1); i <= (n); ++i) scanf("%d", a + i);
  if (s1 > s2) swap(s1, s2);
  l = s2 - s1, r = 1e9;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (check(l))
    printf("%d\n", l);
  else
    printf("%d\n", r);
  return 0;
}
