#include <bits/stdc++.h>
using namespace std;
long long i, j, x, y, z, ans, d, m, k, c, n, low, high, s, f, w;
string s1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n + 4];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  ;
  ans = 10000;
  for (i = 1; i < n - 1; ++i) {
    k = a[0];
    long long maxi = -1;
    for (j = 1; j < n; ++j) {
      if (i == j) continue;
      maxi = max(maxi, a[j] - k);
      k = a[j];
    }
    ans = min(ans, maxi);
  }
  cout << ans;
}
