#include <bits/stdc++.h>
int main() {
  int n, i, j, c = 0, r = 0, max = 0, min, temp;
  scanf("%d", &n);
  int ar[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &ar[i]);
    if (ar[i] > max) max = ar[i];
  }
  min = max;
  max = 0;
  for (i = 1; i < n - 1; i++) {
    for (j = 0; j < n - 1; j++) {
      if (i - j == 1) {
        r = abs(ar[i + 1] - ar[j]);
        j++;
      } else if (i != j) {
        r = abs(ar[j + 1] - ar[j]);
      }
      if (r > max) max = r;
    }
    if (max < min) min = max;
    max = 0;
  }
  printf("%d", min);
}
