#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ori[107] = {}, arr[107];
  scanf("%d %d", &n, ori);
  int dmax = 0;
  for (int i = 1; i < n; ++i) {
    scanf("%d", ori + i);
    arr[i] = ori[i] - ori[i - 1];
    dmax = max(dmax, arr[i]);
  }
  int cmin = 100000;
  for (int i = 1; i < n - 1; ++i) {
    cmin = min(cmin, arr[i] + arr[i + 1]);
  }
  printf("%d", max(cmin, dmax));
}
