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