#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 1;
const int mod = int(1e9) + 7;
int cmpfunc(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int a[105];
int b[105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    b[i - 1] = a[i] - a[i - 1];
  }
  int mn = 1e6, mni = -1;
  for (int i = 0; i < n - 2; i++) {
    if (b[i] + b[i + 1] < mn) {
      mn = b[i] + b[i + 1];
      mni = i;
    }
  }
  int mx = -1;
  for (int i = 0; i < mni; i++) {
    mx = max(b[i], mx);
  }
  for (int i = mni + 2; i < n - 1; i++) {
    mx = max(b[i], mx);
  }
  cout << max(mx, mn);
  return 0;
}
