#include <bits/stdc++.h>
using namespace std;
int main() {
  int max, min = 9999, diff;
  int n;
  int array[100] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) cin >> array[i];
  for (int i = 1; i < n - 1; i++) {
    max = 0;
    for (int j = 1; j < n; j++) {
      if (i == j)
        diff = array[j + 1] - array[j - 1];
      else
        diff = array[j] - array[j - 1];
      if (diff >= max) max = diff;
    }
    if (max <= min) min = max;
  }
  cout << min << endl;
  return 0;
}
