#include <bits/stdc++.h>
using namespace std;
int N, s1, s2;
int data[100001];
bool isRange(int x, int y, int z) {
  if (z >= x && z <= y) return true;
  return false;
}
int check(int x) {
  int L = data[N] - x;
  int R = data[N] + x;
  for (int i = N - 1; i >= 1; i--) {
    if (isRange(L, R, data[i])) {
      L = data[i] - x;
      R = data[i] + x;
    } else {
      L = max(L, data[i] - x);
      R = min(R, data[i] + x);
    }
  }
  return isRange(L, R, s1) || isRange(L, R, s2);
}
int main() {
  cin >> N >> s1 >> s2;
  for (int i = 1; i <= N; i++) {
    cin >> data[i];
  }
  int L = abs(s1 - s2);
  int R = 1000000000;
  while (L <= R) {
    int mid = (L + R) >> 1;
    if (check(mid)) {
      R = mid - 1;
    } else {
      L = mid + 1;
    }
  }
  cout << L;
}
