#include <bits/stdc++.h>
using namespace std;
int n, s1, s2;
int a[100005];
inline int read() {
  int s = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -1;
  for (; isdigit(c); c = getchar()) s = (s << 1) + (s << 3) + (c ^ 48);
  return s * w;
}
inline bool check(int x) {
  int l = -0x3f3f3f3f, r = 0x3f3f3f3f;
  for (register int i = n; i >= 1; i--) {
    if (l <= a[i] && 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 (l <= s1 && s1 <= r) || (l <= s2 && s2 <= r);
}
int main() {
  n = read(), s1 = read(), s2 = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  int l = abs(s1 - s2), r = 0x3f3f3f3f;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", l);
  return 0;
}
