#include <bits/stdc++.h>
using namespace std;
int n, s1, s2, x[100005];
set<int> S;
bool check(int X) {
  S.clear();
  S.insert(s1);
  S.insert(s2);
  for (int i = 1; i <= n; i++) {
    while (!S.empty() && abs((*S.begin()) - x[i]) > X) S.erase(S.begin());
    while (!S.empty() && abs(x[i] - *prev(S.end())) > X) S.erase(prev(S.end()));
    if (S.empty()) return 0;
    S.insert(x[i]);
  }
  return 1;
}
signed main() {
  scanf("%d %d %d", &n, &s1, &s2);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  int l = abs(s1 - s2), r = 1e9, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
