#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; ++i) cin >> arr[i];
  int dd[n - 1];
  for (int i = 0; i < n - 1; ++i) {
    dd[i] = arr[i + 1] - arr[i];
  }
  int d;
  d = *max_element(dd, dd + n - 1);
  int dif[n - 2];
  for (int i = 0; i < n - 2; ++i) dif[i] = arr[i + 2] - arr[i];
  int ddd;
  ddd = *min_element(dif, dif + n - 2);
  cout << max(d, ddd);
  return 0;
}
