#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(int a) {
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(int a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  write(a);
  puts("");
}
const int N = 100005;
int a[N], sx, sy, n;
set<int> s;
inline bool check(int x) {
  set<int>::iterator it;
  s.clear();
  s.insert(sx);
  s.insert(sy);
  for (int i = 1; i <= n; i++) {
    for (it = s.begin(); it != s.end();) {
      if (*it < a[i] - x)
        s.erase(it++);
      else
        break;
    }
    if (s.empty()) return 0;
    it = s.end();
    it--;
    for (;;) {
      if (*it > a[i] + x) {
        if (it == s.begin()) return 0;
        s.erase(it--);
      } else
        break;
    }
    if (s.empty()) return 0;
    s.insert(a[i]);
  }
  return 1;
}
int main() {
  n = read();
  sx = read();
  sy = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  int l = abs(sy - sx), r = 1e9;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  writeln(l);
}
