#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[1000];
  int n;
  cin >> n;
  int i;
  for (i = 0; i < n; ++i) cin >> a[i];
  int minn = 10000;
  for (i = 1; i < n - 1; ++i)
    if (a[i + 1] - a[i - 1] < minn) {
      minn = a[i + 1] - a[i - 1];
    }
  for (i = 1; i < n; ++i)
    if (a[i] - a[i - 1] > minn) minn = a[i] - a[i - 1];
  cout << minn << endl;
  return 0;
}
