#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[10000];
  vector<int> u;
  int mx = 0;
  int n;
  cin >> n;
  for (int x = 0; x < n; ++x) {
    if (x == 0)
      cin >> a[x];
    else {
      cin >> a[x];
      mx = max(a[x] - a[x - 1], mx);
    }
  }
  for (int x = 2; x < n; x++) {
    u.push_back(max(a[x] - a[x - 2], mx));
  }
  cout << *min_element(u.begin(), u.end());
}
