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