#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int ans = 10000000000;
  for (int i = 1; i < n - 1; i++) {
    int cnt = 0;
    for (int j = 0; j < n - 1; j++) {
      if (j == i - 1) {
        if (v[j + 2] - v[j] > cnt) cnt = v[j + 2] - v[j];
        j += 1;
      } else if (v[j + 1] - v[j] > cnt)
        cnt = v[j + 1] - v[j];
    }
    if (ans > cnt) ans = cnt;
  }
  cout << ans;
  return 0;
}
