#include <bits/stdc++.h>
using namespace std;
long long a[100100];
long long n, sa, sb;
bool judge(long long x) {
  long long l = a[n] - x, r = a[n] + x;
  for (int i = n - 1; i > 0; i--) {
    if (a[i] >= l && a[i] <= r) {
      l = a[i] - x, r = a[i] + x;
      continue;
    } else {
      l = max(a[i] - x, l);
      r = min(a[i] + x, r);
      if (l > r) return 0;
    }
  }
  if ((sa >= l && sa <= r) || (sb >= l && sb <= r)) {
    return 1;
  } else
    return 0;
}
int main() {
  while (cin >> n >> sa >> sb) {
    if (sa > sb) swap(sa, sb);
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    long long l = sb - sa, r = 1e9, ans = l;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (judge(mid))
        ans = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    cout << ans << endl;
  }
  return 0;
}
