#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, mod = 1e9 + 7;
int n, s0, s1, a[N];
bool dp[N][2];
bool check(int maxdis) {
  if (abs(s1 - s0) > maxdis) return false;
  memset(dp, 0, sizeof(dp));
  dp[0][0] = dp[0][1] = true;
  deque<pair<int, int> > mn[2], mx[2];
  mn[0].push_back({0, s1});
  mx[0].push_back({0, s1});
  mn[1].push_back({0, s0});
  mx[1].push_back({0, s0});
  int cur[2] = {1, 1};
  for (int i = 0; i <= n && max(cur[0], cur[1]) <= n; i++) {
    if (!dp[i][0] && !dp[i][1]) return false;
    for (int j = 0; j < 2; j++) {
      while (mn[j].size() && mn[j][0].first <= i) mn[j].pop_front();
      while (mx[j].size() && mx[j][0].first <= i) mx[j].pop_front();
      if (!dp[i][j]) continue;
      int val = a[i];
      if (i == 0) {
        if (j == 0)
          val = s0;
        else
          val = s1;
      }
      if (mn[j].size() && abs(mn[j][0].second - val) > maxdis) continue;
      if (mx[j].size() && abs(mx[j][0].second - val) > maxdis) continue;
      while (cur[1 - j] <= n && abs(val - a[cur[1 - j]]) <= maxdis) {
        while (mn[j].size() && mn[j].back().second >= a[cur[1 - j]])
          mn[j].pop_back();
        mn[j].push_back({cur[1 - j], a[cur[1 - j]]});
        while (mx[j].size() && mx[j].back().second <= a[cur[1 - j]])
          mx[j].pop_back();
        mx[j].push_back({cur[1 - j], a[cur[1 - j]]});
        dp[cur[1 - j]][1 - j] = true;
        cur[1 - j]++;
      }
    }
  }
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s0 >> s1;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int l = 0, r = mod;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r;
  return 0;
}
