#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[150], i, j, best, ans = 10000;
  cin >> n;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 1; i < n - 1; ++i) {
    best = 0;
    for (j = 1; j < n; ++j)
      if (j != i)
        best = max(best, a[j] - a[j - 1]);
      else {
        best = max(best, a[j + 1] - a[j - 1]);
        ++j;
      }
    ans = min(ans, best);
  }
  cout << ans;
  return 0;
}
