#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[105];
  int m = 0, k = 10000000;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) m = max(m, a[i + 1] - a[i]);
  for (int i = 0; i < n - 2; i++) k = min(k, max(m, a[i + 2] - a[i]));
  cout << k;
  return 0;
}
