#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cout << fixed;
  int n;
  cin >> n;
  int x;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> x;
    a[i] = x;
  }
  int xmin = INF;
  for (int i = 1; i < n - 1; i++) {
    int c = 0;
    for (int j = 1; j < n; j++) {
      if (j == i) continue;
      if (j == i + 1) {
        c = max(c, a[j] - a[j - 2]);
      } else {
        c = max(c, a[j] - a[j - 1]);
      }
    }
    xmin = min(xmin, c);
  }
  cout << xmin << endl;
  return 0;
}
