#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int temp = 0, res = 0, count = INT_MAX;
  for (int i = 1; i < n - 1; i++) {
    res = 0;
    for (int j = 1; j < n; j++) {
      if (j == i) {
        continue;
      }
      if (j == i + 1) {
        temp = a[j] - a[i - 1];
        res = max(temp, res);
      } else {
        temp = a[j] - a[j - 1];
        res = max(temp, res);
      }
    }
    count = min(count, res);
  }
  cout << count << endl;
}
