#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const int logn = log2(maxn) + 1;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("A"
            ".INP",
            "r")) {
    freopen(
        "A"
        ".INP",
        "r", stdin);
    freopen(
        "A"
        ".OUT",
        "w", stdout);
  }
  int n, s1, s2;
  cin >> n >> s1 >> s2;
  vector<int> a(n);
  for (auto& c : a) cin >> c;
  auto check = [&](int lim) -> bool {
    set<int> s;
    s.insert(s1);
    s.insert(s2);
    for (auto& c : a) {
      while (s.size() && (*s.begin()) + lim < c) s.erase(*s.begin());
      while (s.size() && (*s.rbegin()) > c + lim) s.erase(*s.rbegin());
      if (s.size() == 0) return 0;
      s.insert(c);
    }
    return 1;
  };
  int l = abs(s2 - s1), h = 1e9;
  while (l <= h) {
    int mid = l + h >> 1;
    if (check(mid))
      h = mid - 1;
    else
      l = mid + 1;
  }
  cout << l;
}
