#include <bits/stdc++.h>
using namespace std;
int test = 1;
void solve() {
  int N;
  cin >> N;
  vector<int> vc(N);
  for (int i = 0; i < N; i++) cin >> vc[i];
  int mn = 100000000;
  for (int i = 1; i < N - 1; i++) {
    int df = -1;
    for (int j = 0; j < N - 1; j++) {
      df = max(df, (i == j + 1 ? vc[j + 2] : vc[j + 1]) - vc[j]);
    }
    mn = min(mn, df);
  }
  cout << mn << endl;
}
int main() {
  for (int i = 0; i < test; i++) {
    solve();
  }
}
