#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<int> v;
  for (int i = 1; i < n - 1; i++) {
    int m1 = 0;
    for (int j = 1; j < n - 1; j++) {
      if (j == i)
        m1 = max(m1, a[j + 1] - a[j - 1]);
      else
        m1 = max(m1, a[j + 1] - a[j]);
    }
    v.push_back(m1);
  }
  sort(v.begin(), v.end());
  cout << v[0] << endl;
}
