#include <bits/stdc++.h>
using namespace std;
const int N = 100050;
int st_max[N][19];
int st_min[N][19];
int n, a[N], lg[N];
int Get_Max(int x, int y) {
  int z = lg[y - x + 1];
  return max(st_max[x][z], st_max[y - (1 << z) + 1][z]);
}
int Get_Min(int x, int y) {
  int z = lg[y - x + 1];
  return min(st_min[x][z], st_min[y - (1 << z) + 1][z]);
}
bool check(int x) {
  int i, k = 2;
  for (i = 1; i <= n + 2; i++) {
    if (k < i) return 0;
    int lb = i + 1, rb = n + 2;
    while (lb <= rb) {
      int mid = lb + rb >> 1;
      if (Get_Max(lb, mid) <= a[i] + x && Get_Min(lb, mid) >= a[i] - x)
        lb = mid + 1;
      else
        rb = mid - 1;
    }
    if (rb > k) k = rb;
  }
  return 1;
}
int main() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= n + 2; i++) {
    scanf("%d", &a[i]);
    st_max[i][0] = st_min[i][0] = a[i];
  }
  for (j = 1; (1 << j) <= n + 2; j++) {
    for (i = 1; i + (1 << j) - 1 <= n + 2; i++) {
      st_max[i][j] = max(st_max[i][j - 1], st_max[i + (1 << j - 1)][j - 1]);
      st_min[i][j] = min(st_min[i][j - 1], st_min[i + (1 << j - 1)][j - 1]);
    }
  }
  for (i = 1, lg[0] = -1; i <= n + 2; i++) lg[i] = lg[i >> 1] + 1;
  int lb = abs(a[1] - a[2]), rb = 1e9;
  while (lb <= rb) {
    int mid = lb + rb >> 1;
    if (check(mid))
      rb = mid - 1;
    else
      lb = mid + 1;
  }
  printf("%d\n", lb);
  return 0;
}
