#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  long long n, a, x, mn, y, l, mn1, mn2;
  cin >> n;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
  }
  mn = 999999999999;
  for (int i = 1; i < n - 1; i++) {
    mn1 = 0;
    for (int j = 1; j < n - 1; j++) {
      if (i == j) {
        mn1 = max(mn1, v[j + 1] - v[j - 1]);
      } else {
        mn1 = max(mn1, v[j + 1] - v[j]);
      }
    }
    mn = min(mn1, mn);
  }
  cout << mn << endl;
  return 0;
}
