#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 mind = INT_MAX;
  for (int i = 1; i < n - 1; i++) {
    int diff = 0;
    for (int j = 0; j < n - 1; j++) {
      int d = 0;
      if (j == i - 1)
        d = a[j + 2] - a[j];
      else if (j == i)
        d = a[j + 1] - a[j - 1];
      else
        d = a[j + 1] - a[j];
      if (diff < d) diff = d;
    }
    if (mind > diff) mind = diff;
  }
  cout << mind;
}
