#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000100;
const int INF = (1 << 29);
const double EPS = 0.00000000001;
const double Pi = acos(-1.0);
int a[maxn], n;
int b[maxn];
int del(int x) {
  int m = 0;
  for (int i = 1; i <= n; i++)
    if (i != x) b[++m] = a[i];
  int res = -INF;
  for (int i = 1; i <= m - 1; i++) {
    res = max(res, b[i + 1] - b[i]);
  }
  return res;
}
int main() {
  while (cin >> n) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int ans = INF;
    for (int i = 2; i <= n - 1; i++) {
      int t = del(i);
      ans = min(ans, t);
    }
    cout << ans << endl;
  }
  return 0;
}
