#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, d[1005], a[1005], s;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n - 1; i++) {
    d[i] = a[i + 1] - a[i];
    s = max(s, d[i]);
  }
  k = 100000000000000;
  for (i = 0; i < n - 2; i++) {
    if (d[i] + d[i + 1] < k) k = d[i] + d[i + 1];
  }
  cout << max(k, s);
}
