#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int mn = INT_MAX;
  for (int i = 1; i < n - 1; i++) {
    int tmp = 0;
    for (int j = 1; j < n; j++) {
      if (j == i) continue;
      tmp = max(tmp, a[j] - ((j == i + 1) ? a[j - 2] : a[j - 1]));
    }
    mn = min(mn, tmp);
  }
  cout << mn << endl;
  return 0;
}
