#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, i = 999999, j, k, l;
  cin >> n;
  long int arr[n];
  for (j = 0; j < n; j++) cin >> arr[j];
  for (j = 1; j < n - 1; j++) {
    l = 0;
    for (k = 0; k < n - 1; k++) {
      if (k == j)
        l = max(l, arr[k + 1] - arr[k - 1]);
      else if (k + 1 == j)
        l = max(l, arr[k + 2] - arr[k]);
      else
        l = max(l, arr[k + 1] - arr[k]);
    }
    if (i > l) i = l;
  }
  cout << i << endl;
  return 0;
}
