#include <bits/stdc++.h>
using namespace std;
int a[10005] = {0};
int main() {
  int n;
  cin >> n;
  int pre = 0, Max = -1, Maxpos = 0;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    if (i == 0) {
      pre = num;
      continue;
    }
    a[i] = num - pre;
    if (Max < a[i]) {
      Max = max(Max, a[i]);
      Maxpos = i;
    }
    pre = num;
  }
  int Min = 0x3f3f3f3f;
  for (int i = 1; i < n - 1; i++) {
    Min = min(a[i + 1] + a[i], Min);
  }
  cout << max(Max, Min) << endl;
}
