#include <bits/stdc++.h>
using namespace std;
long long n, res = LLONG_MIN, a[10005], f[10005], ans = LLONG_MAX;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 2; i <= n - 1; i++) {
    res = LLONG_MIN;
    for (long long j = 2; j <= n; j++)
      if (j == i)
        res = max(res, a[j + 1] - a[j - 1]);
      else
        res = max(res, a[j] - a[j - 1]);
    ;
    ans = min(ans, res);
  }
  cout << ans << endl;
  return 0;
}
