#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> V;
  V.reserve(101);
  int tmp;
  for (int i = 0; i < n; ++i) {
    cin >> tmp;
    V.push_back(tmp);
  }
  int res = 2001;
  for (int i = 1; i < (n - 1); ++i) {
    int maxstep = 0;
    for (int j = 0; j < (n - 1); ++j) {
      if (j != i && j + 1 != i)
        maxstep = max(maxstep, V[j + 1] - V[j]);
      else if (j == i)
        maxstep = max(maxstep, V[j + 1] - V[j - 1]);
    }
    res = min(res, maxstep);
  }
  cout << res;
  return 0;
}
