#include <bits/stdc++.h>
using namespace std;
int INF = 1000000;
int main() {
  int n;
  scanf("%d", &n);
  int mas[n];
  int min_l = INF;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &mas[i]);
  }
  for (int j = 1; j < n - 1; ++j) {
    int max_t = 0;
    for (int i = 1; i < n; ++i) {
      if (i == j) {
        max_t = max(max_t, mas[i + 1] - mas[i - 1]);
      } else {
        max_t = max(max_t, mas[i] - mas[i - 1]);
      }
    }
    min_l = min(min_l, max_t);
  }
  printf("%d", min_l);
  return 0;
}
