#include <bits/stdc++.h>
const int N = 100010;
int n, s1, s2, t[N];
bool check(int dis) {
  std::set<int> s;
  s.insert(s1);
  s.insert(s2);
  for (int i = 1; i <= n; i++) {
    while (!s.empty() && abs(*s.begin() - t[i]) > dis) s.erase(s.begin());
    while (!s.empty() && abs(*prev(s.end()) - t[i]) > dis)
      s.erase(prev(s.end()));
    if (s.empty()) return false;
    s.insert(t[i]);
  }
  return true;
}
int main() {
  scanf("%d%d%d", &n, &s1, &s2);
  t[0] = s1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
  }
  int l = abs(s1 - s2), r = 1e9;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d", l);
  return 0;
}
