#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> a, b;
  long long n, x, m = 1, C = 0, R = 1001;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < n - 2; i++) {
    b = a;
    b.erase(b.begin() + m);
    for (int j = 0; j < b.size() - 1; j++) {
      C = max(C, (b[j + 1] - b[j]));
    }
    R = min(R, C);
    C = 0;
    m++;
  }
  cout << R;
  return 0;
}
