#include <bits/stdc++.h>
using namespace std;
using std::bitset;
const double Pi = acos(-1);
inline int read() {
  int x = 0;
  bool fu = 0;
  char ch = 0;
  while (ch > '9' || ch < '0') {
    ch = getchar();
    if (ch == '-') fu = 1;
  }
  while (ch <= '9' && ch >= '0') x = (x * 10 - 48 + ch), ch = getchar();
  return fu ? -x : x;
}
inline char readc() {
  register char c;
  while ((c = getchar()) == ' ' || c == '\n')
    ;
  return c;
}
int n, s1, s2, a[100002], l, r, mid;
set<int> p;
set<int>::iterator d, nxt;
bool check(int num) {
  p.clear();
  p.insert(s2);
  for (register int i = 1, iend = n; i <= iend; ++i) {
    while (!p.empty() && abs(*p.begin() - a[i]) > num) p.erase(p.begin());
    if (!p.empty()) {
      d = p.end(), d--;
      while (!p.empty() && abs((*d) - a[i]) > num) {
        nxt = d;
        d--;
        p.erase(nxt);
      }
    }
    if (abs(a[i] - a[i - 1]) <= num) p.insert(a[i - 1]);
    if (p.empty()) return 0;
  }
  return 1;
}
int main() {
  cin >> n >> s1 >> s2;
  a[0] = s1;
  for (register int i = 1, iend = n; i <= iend; ++i) a[i] = read();
  l = abs(s1 - s2), r = 1000000000;
  while (l < r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l;
  return 0;
}
