#include <bits/stdc++.h>
using namespace std;
int n, a[107];
void solve() {
  int i, min = 10000000, max = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n - 1; i++) {
    if (a[i + 1] - a[i] > max) {
      max = a[i + 1] - a[i];
    }
  }
  for (i = 0; i < n - 2; i++) {
    if (a[i + 2] - a[i] < min) {
      min = a[i + 2] - a[i];
    }
  }
  if (max > min) {
    min = max;
  }
  printf("%d\n", min);
}
int main() {
#pragma comment(linker, "/STACK:67108864")
  while (scanf("%d", &n) != EOF) {
    solve();
  }
  return 0;
}
