#include <bits/stdc++.h>
using namespace std;
int a[1005];
int res[1000005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  int cnt = 0;
  for (int i = 1; i < n - 1; i++) {
    int t, temp = -1;
    for (int k = 1; k < n; k++) {
      if (k == i)
        t = a[k + 1] - a[k - 1];
      else
        t = a[k] - a[k - 1];
      if (t > temp) temp = t;
    }
    res[cnt++] = temp;
  }
  sort(res, res + cnt);
  printf("%d\n", res[0]);
  return 0;
}
