#include <bits/stdc++.h>
using namespace std;
int b[101], c[101];
int main() {
  int n, a[101], min = 1001;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n - 1; i++) {
    int max = 0;
    for (int j = 1; j < n; j++) {
      if (j == i) {
        if (a[j + 1] - a[j - 1] > max) max = a[j + 1] - a[j - 1];
      }
      if (j - i == 1)
        continue;
      else if (a[j] - a[j - 1] > max)
        max = a[j] - a[j - 1];
    }
    c[i - 1] = max;
  }
  for (int i = 0; i < n - 2; i++) {
    if (c[i] < min) min = c[i];
  }
  cout << min;
}
