#include <bits/stdc++.h>
const int maxn = 1e3 + 10;
using namespace std;
int n, a[100100], out[100100], gout[100100], cnt1, sal1, sal2, sal3;
int main() {
  int maxx = -999999, cnt = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 2; i <= n - 1; i++) {
    sal1 = a[i + 1] - a[i - 1];
    for (int j = 1; j <= i - 1 - 1; j++) {
      sal2 = a[j + 1] - a[j];
      if (sal2 > maxx) {
        maxx = sal2;
      }
    }
    for (int k = i + 1; k <= n - 1; k++) {
      sal3 = a[k + 1] - a[k];
      if (sal3 > maxx) {
        maxx = sal3;
      }
    }
    if (sal1 > maxx) {
      maxx = sal1;
    }
    out[cnt] = maxx;
    cnt++;
    maxx = -999999;
    sort(out, out + cnt);
    gout[cnt1] = out[0];
    cnt1++;
  }
  sort(gout, gout + cnt1);
  cout << gout[0];
  return 0;
}
