#include <bits/stdc++.h>
namespace my_std {
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
inline T rnd(T l, T r) {
  return uniform_int_distribution<T>(l, r)(rng);
}
template <typename T>
inline void read(T& t) {
  t = 0;
  char f = 0, ch = getchar();
  double d = 0.1;
  while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
  while (ch <= '9' && ch >= '0') t = t * 10 + ch - 48, ch = getchar();
  if (ch == '.') {
    ch = getchar();
    while (ch <= '9' && ch >= '0') t += d * (ch ^ 48), d *= 0.1, ch = getchar();
  }
  t = (f ? -t : t);
}
template <typename T, typename... Args>
inline void read(T& t, Args&... args) {
  read(t);
  read(args...);
}
void file() {}
long long ksm(long long x, int y) {
  long long ret = 1;
  for (; y; y >>= 1, x = x * x)
    if (y & 1) ret = ret * x;
  return ret;
}
}  // namespace my_std
using namespace my_std;
int n, s1, s2;
int pos[101010];
bool check(int len) {
  set<int> s;
  s.insert(s2);
  for (int i = (0); i <= (n - 1); i++) {
    if (s.empty()) return 0;
    s.insert(pos[i]);
    auto it = s.end();
    --it;
    while (abs(*it - pos[i + 1]) > len) {
      if (s.size() == 1) return 0;
      s.erase(it--);
    }
    it = s.begin();
    while (abs(*it - pos[i + 1]) > len) {
      if (s.size() == 1) return 0;
      s.erase(it++);
    }
  }
  return 1;
}
int main() {
  file();
  read(n, s1, s2);
  pos[0] = s1;
  for (int i = (1); i <= (n); i++) read(pos[i]);
  int l = abs(s1 - s2), r = 1e9, ans;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ans;
  return 0;
}
