#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n], mxd = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n - 1; i++) {
    mxd = max(mxd, abs(a[i] - a[i + 1]));
  }
  long long ans = LONG_MAX;
  for (long long i = 0; i < n - 2; i++) {
    ans = min(ans, abs(a[i] - a[i + 2]));
  }
  cout << max(ans, mxd) << "\n";
}
