#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int k = 1;
  int ans = INT_MAX;
  for (int i = 0; i < n - 2; i++) {
    int m = 0;
    for (int j = 0; j < n - 1; j++) {
      if (k == j + 1) {
        m = max(m, a[j + 2] - a[j]);
        j = j + 1;
      } else {
        m = max(m, a[j + 1] - a[j]);
      }
    }
    k++;
    ans = min(ans, m);
  }
  cout << ans;
}
