#include <bits/stdc++.h>
using namespace std;
namespace Fread {
const int MAXN = 1 << 20;
char buf[MAXN], *S, *T;
inline char getchar() {
  if (S == T) {
    T = (S = buf) + fread(buf, 1, MAXN, stdin);
    if (S == T) return EOF;
  }
  return *S++;
}
}  // namespace Fread
inline int read() {
  int x(0), neg(1);
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') neg = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch - '0');
    ch = getchar();
  }
  return x * neg;
}
const int MAXN = 100000;
int n, s0, s1;
int a[MAXN + 5];
set<int> s;
inline bool ok(int x) {
  s.clear();
  s.insert(s0), s.insert(s1);
  for (int i = 1; i <= n; ++i) {
    while (!s.empty() && (abs(a[i] - *s.begin()) > x)) s.erase(s.begin());
    while (!s.empty() && (abs(a[i] - *prev(s.end())) > x))
      s.erase(prev(s.end()));
    if (s.empty()) return 0;
    s.insert(a[i]);
  }
  return 1;
}
signed main() {
  scanf("%d%d%d", &n, &s0, &s1);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int l = abs(s0 - s1), r = 1e9 + 5, ans = 0;
  while (l <= r) {
    int mid = l + r >> 1;
    if (ok(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
