#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int minn = 9999999;
  for (int i = 1; i <= n - 2; i++) {
    int diff;
    int maxx = 0;
    for (int j = 0; j <= n - 2; j++) {
      if (j + 1 == i) {
        diff = abs(arr[j] - arr[j + 2]);
        j++;
      } else {
        diff = abs(arr[j] - arr[j + 1]);
      }
      maxx = max(maxx, diff);
    }
    minn = min(minn, maxx);
  }
  cout << minn;
}
