#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = INT_MAX;
  for (long long i = 1; i < n - 1; i++) {
    long long temp = INT_MIN;
    for (long long j = 0; j < n - 1; j++) {
      if (i - 1 == j) {
        continue;
      }
      if (i == j) {
        temp = max(temp, a[j + 1] - a[j - 1]);
        continue;
      }
      temp = max(temp, a[j + 1] - a[j]);
    }
    ans = min(ans, temp);
  }
  cout << ans << "\n";
  return;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
