#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int diff = v[2] - v[0];
  int diff2 = v[1] - v[0];
  int counter = 1;
  for (int i = 1; i < n - 2; i++) {
    int k = v[i + 2] - v[i];
    int t = v[i + 1] - v[i];
    if (k < diff) diff = k;
    if (t > diff2) diff2 = t;
  }
  if (diff2 < v[n - 1] - v[n - 2]) diff2 = v[n - 1] - v[n - 2];
  if (diff2 > diff)
    cout << diff2;
  else
    cout << diff << endl;
  return 0;
}
