#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = int(0); i <= int(n - 1); i++) cin >> arr[i];
  vector<vector<int> > mn(n, vector<int>(n, 0));
  for (int i = int(0); i <= int(n - 1); i++) {
    for (int j = int(i + 1); j <= int(n - 1); j++) {
      mn[i][j] = max(arr[j] - arr[j - 1], mn[i][j - 1]);
    }
  }
  int res = 2000000000;
  for (int i = int(1); i <= int(n - 2); i++) {
    res = min(
        res, max(arr[i + 1] - arr[i - 1], max(mn[0][i - 1], mn[i + 1][n - 1])));
  }
  cout << res << endl;
}
