#include <bits/stdc++.h>
using namespace std;
const int N = 200020;
int a[N];
int main(void) {
  int n;
  scanf("%d", &n);
  int ans = 0x3f3f3f3f;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 1; i + 1 < n; i++) {
    int r = 0;
    for (int j = 1; j < n; j++) {
      if (j - 1 == i)
        r = max(r, a[j] - a[j - 2]);
      else
        r = max(r, a[j] - a[j - 1]);
    }
    ans = min(ans, r);
  }
  cout << ans << endl;
  return 0;
}
