#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x, d = INT_MIN, res = INT_MAX;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 1; i < n - 1; i++) {
    for (j = 0; j < n - 1; j++) {
      if (j == i) {
      } else if (j + 1 == i)
        x = a[j + 2] - a[j];
      else
        x = a[j + 1] - a[j];
      if (x > d) d = x;
    }
    if (d < res) res = d;
    d = INT_MIN;
  }
  cout << res;
  return 0;
}
