#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> input;
  input.reserve(n);
  while (n--) {
    int a;
    cin >> a;
    input.emplace_back(a);
  }
  int dif;
  int res = INT_MAX;
  for (int i = 1; i < input.size() - 1; i++) {
    dif = INT_MIN;
    for (int j = 1; j < input.size(); j++) {
      if (j == i) continue;
      int previous = j - 1;
      if (previous == i) {
        previous = j - 2;
      }
      int temp = input[j] - input[previous];
      if (temp > dif) {
        dif = temp;
      }
    }
    if (res > dif) {
      res = dif;
    }
  }
  cout << res << endl;
  return 0;
}
