#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j = 2, l = 1, k = 1, ans = 1, mi = INT_MAX;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; j < n - 1; i++, j++) {
    mi = min(a[j] - a[i], mi);
    if (mi > a[j + 1] - a[i + 1]) {
      l = (j + i + 2) / 2;
    }
  }
  for (int i = 0; k < n; i++, k++) {
    if (k == l) {
      ans = max(ans, a[l + 1] - a[l - 1]);
      i++;
      k++;
    } else {
      ans = max(ans, a[k] - a[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
