#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[1113];
  cin >> n;
  int d = 100000000;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  a[n + 1] = -10;
  for (int i = 2; i <= n - 1; i++) {
    int pos = i;
    int dax = -1;
    bool k = 1;
    for (int j = 1; j <= n - 1; j++) {
      if (j != pos) {
        if (pos == j + 1) {
          if (a[j + 2] - a[j] > dax) {
            dax = a[j + 2] - a[j];
            k = 1;
          }
        } else {
          if (a[j + 1] - a[j] > dax) {
            dax = a[j + 1] - a[j];
            k = 1;
          }
        }
      }
    }
    if (dax < d && k) {
      d = dax;
    }
  }
  cout << d;
}
