#include <bits/stdc++.h>
using namespace std;
int n, s1, s2, ans, mid, l, r;
int x[100010];
set<int> s;
set<int>::iterator it;
inline int jue(int x) { return x > 0 ? x : -x; }
int check(int mid) {
  s.clear();
  s.insert(s1);
  s.insert(s2);
  for (int i = 1; i <= n; ++i) {
    for (it = s.begin(); !s.empty(); it = s.begin())
      if (jue(x[i] - *it) > mid)
        s.erase(it);
      else
        break;
    if (s.empty()) return 0;
    for (it = s.end(), --it; !s.empty(); it = s.end(), --it)
      if (jue(x[i] - *it) > mid)
        s.erase(it);
      else
        break;
    if (s.empty()) return 0;
    s.insert(x[i]);
  }
  return 1;
}
int main() {
  cin >> n >> s1 >> s2;
  for (int i = 1; i <= n; ++i) scanf("%d", &x[i]);
  l = jue(s1 - s2);
  r = 1e9 + 1;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ans;
}
