#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, array[103];
  int maxx = -1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> array[i];
    if (i > 1) {
      maxx = max(maxx, array[i] - array[i - 1]);
    }
  }
  int ans = 100000;
  int tmp = -1;
  for (int i = 2; i < n; i++) {
    tmp = max(array[i + 1] - array[i - 1], maxx);
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
