#include <bits/stdc++.h>
const int MAXN = 1e5 + 5;
const int MOD = 19260827;
int n, s1, s2;
int ta[MAXN];
inline bool chck(int val) {
  int l = 0x80808080, r = 0x3f3f3f3f;
  for (int i = n; i >= 1; --i) {
    if (l <= ta[i] && ta[i] <= r)
      l = ta[i] - val, r = ta[i] + val;
    else
      l = std::max(l, ta[i] - val), r = std::min(r, ta[i] + val);
  }
  return (l <= s1 && s1 <= r) || (l <= s2 && s2 <= r);
}
int main() {
  scanf("%d%d%d", &n, &s1, &s2);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &ta[i]);
  }
  int l = std::abs(s1 - s2), r = 0x3f3f3f3f;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (chck(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", l);
  return 0;
}
