#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int val[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &val[i]);
  }
  int mx = val[n - 1] - val[0];
  for (int i = 1; i < n - 1; i++) {
    int cmx = 0;
    for (int j = 1; j < n; j++) {
      if (j == i) continue;
      if (j == i + 1)
        cmx = max(cmx, val[j] - val[j - 2]);
      else
        cmx = max(cmx, val[j] - val[j - 1]);
    }
    mx = min(mx, cmx);
  }
  printf("%d\n", mx);
}
