#include <bits/stdc++.h>
using namespace std;
void MinimumDifficulty() {
  int n, mn = 1000, mx = 0, tmp;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int j = 1; j < n - 1; j++) {
    mx = 0;
    for (int i = 0; i < n - 1; i++) {
      if (i + 1 == j) {
        tmp = a[j + 1] - a[i];
        i = j;
      } else {
        tmp = a[i + 1] - a[i];
      }
      if (tmp > mx) mx = tmp;
    }
    if (mn > mx) mn = mx;
  }
  cout << mn;
}
int main() {
  MinimumDifficulty();
  return 0;
}
