#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::max;
using std::min;
using std::vector;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  int ans = 1001001001;
  for (int i = 0; i + 2 < n; ++i) {
    int d = a[i + 2] - a[i];
    ans = min(ans, d);
  }
  for (int i = 0; i + 1 < n; ++i) {
    int d = a[i + 1] - a[i];
    ans = max(ans, d);
  }
  cout << ans << '\n';
  return 0;
}
