#include <bits/stdc++.h>
using namespace std;
int n, s1, s2, point[100005];
bool ok(int dist) {
  int lef = point[n] - dist, rig = point[n] + dist;
  for (int i = n - 1; i >= 1; i--) {
    if (lef > rig) return false;
    if (lef <= point[i] && point[i] <= rig)
      lef = point[i] - dist, rig = point[i] + dist;
    else {
      lef = max(lef, point[i] - dist);
      rig = min(rig, point[i] + dist);
    }
  }
  if (lef > rig) return false;
  if (lef <= s1 && s1 <= rig) return true;
  if (lef <= s2 && s2 <= rig) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s1 >> s2;
  for (int i = 1; i <= n; i++) cin >> point[i];
  int lef = abs(s1 - s2) - 1, rig = (int)1e9;
  while (lef + 1 < rig) {
    int mid = (lef + rig) / 2;
    if (ok(mid))
      rig = mid;
    else
      lef = mid;
  }
  cout << rig;
  return 0;
}
