#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int ans = INT_MAX;
  for (int i = 1; i <= n - 2; i++) {
    int mask = i;
    vector<int> v;
    for (int j = 0; j < n; j++) {
      if (j != mask) v.push_back(arr[j]);
    }
    int temp = 0;
    for (int j = 0; j < v.size() - 1; j++) {
      temp = max(temp, v[j + 1] - v[j]);
    }
    ans = min(ans, temp);
  }
  cout << ans << endl;
}
