#include <bits/stdc++.h>
using namespace std;
int maxi(int d[], int l, int r) {
  int n = d[l];
  int i;
  if (r < l) return 0;
  for (i = l + 1; i <= r; i++) {
    n = max(n, d[i]);
  }
  return n;
}
int minDifficulty(int a[], int n) {
  int diff[n - 1];
  int mini = INT_MAX, max1, max2, d, i;
  for (i = 1; i <= n - 1; i++) {
    diff[i - 1] = a[i] - a[i - 1];
  }
  for (i = 1; i < n - 1; i++) {
    d = a[i + 1] - a[i - 1];
    max1 = maxi(diff, 0, i - 2);
    max2 = maxi(diff, i + 1, n - 2);
    max1 = max(max1, max2);
    max1 = max(d, max1);
    mini = min(max1, mini);
  }
  return mini;
}
int main() {
  int n, i;
  int a[105];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << minDifficulty(a, n) << endl;
  return 0;
}
