#include <bits/stdc++.h>
using namespace std;
int n, ll, rr;
int a[100005];
inline bool check(int x) {
  int bl = ll, br = rr;
  set<int> s;
  s.insert(ll), s.insert(rr);
  for (int i = 1; i <= n; ++i) {
    while (!s.empty() && (abs(*s.begin() - a[i])) > x) s.erase(s.begin());
    while (!s.empty() && (abs(*(--s.end()) - a[i])) > x) s.erase(--s.end());
    if (s.empty()) return false;
    s.insert(a[i]);
  }
  return true;
}
int main() {
  scanf("%d%d%d", &n, &ll, &rr);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  int l = abs(rr - ll), r = 1e9, ans;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d", ans);
  return 0;
}
