#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int rem(int idx) {
  int dif = 0;
  for (int i = 0; i < ((int)((a).size())); ++i) {
    if (i == a.size() - 1) break;
    if (i == idx - 1) {
      dif = max(dif, a[i + 2] - a[i]);
      i++;
      continue;
    } else {
      dif = max(dif, a[i + 1] - a[i]);
    }
  }
  return dif;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  int res = 1e9;
  for (int i = 1; i < n - 1; i++) {
    res = min(res, rem(i));
  }
  cout << res << endl;
}
