#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d = 0, final = 1000;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    d = (i != 0) ? max(d, a[i] - a[i - 1]) : d;
  }
  for (int i = 2; i < n; i++) final = min(final, max(d, a[i] - a[i - 2]));
  cout << final << endl;
}
