#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, s1, s2, Max, l, r, ans, a[N];
bool check(int d) {
  int l = a[n] - d, r = a[n] + d;
  for (int i = n - 1; i >= 1; 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 0;
  }
  if (l <= s1 && s1 <= r || l <= s2 && s2 <= r) return 1;
  return 0;
}
int main() {
  scanf("%d%d%d", &n, &s1, &s2);
  Max = abs(s1 - s2);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), Max = max(Max, a[i]);
  l = abs(s1 - s2);
  r = Max;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
