#include <bits/stdc++.h>
using namespace std;
int MinimumValue(int arr[], int N) {
  int MinValue = INT_MAX;
  for (int i = 1; i < N - 1; i++) {
    int MaxDiff = INT_MIN;
    for (int j = 1; j < N; j++) {
      if (i == j) {
        MaxDiff = max(MaxDiff, arr[i + 1] - arr[i - 1]);
        j++;
      } else {
        MaxDiff = max(MaxDiff, arr[j] - arr[j - 1]);
      }
    }
    MinValue = min(MinValue, MaxDiff);
  }
  return MinValue;
}
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int ans = MinimumValue(arr, n);
  cout << ans;
  return 0;
}
