#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
const int inf = 2e9;
const int nbits = 30;
const int MOD = 1e9;
const int mx = 30000000;
const int C = 100;
int n, s1, s2, x[N];
set<int> q;
bool check(int d, int s1, int s2) {
  if (abs(s1 - s2) > d) return false;
  x[0] = s2;
  q.clear();
  q.insert(s1);
  for (int i = 1; i <= n; i++) {
    int L = x[i] - d;
    int R = x[i] + d;
    while (true) {
      if (q.size() == 0) break;
      if (*q.begin() >= L) break;
      q.erase(q.begin());
    }
    while (true) {
      if (q.size() == 0) break;
      set<int>::iterator it = q.end();
      it--;
      if (*it <= R) break;
      q.erase(it);
    }
    if (x[i - 1] >= L && x[i - 1] <= R) q.insert(x[i - 1]);
    if (q.size() == 0) return false;
  }
  return true;
}
int main() {
  scanf("%d%d%d", &n, &s1, &s2);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  int l = 0, r = 1e9;
  while (l + 1 < r) {
    int m = (l + r) / 2;
    if (check(m, s1, s2))
      r = m;
    else
      l = m + 1;
  }
  int ans;
  if (check(l, s1, s2))
    ans = l;
  else
    ans = r;
  cout << ans;
  return 0;
}
