#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, curr, ans = 2000, left, right, index = -1;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n - 1; i++)
    if (a[i + 1] - a[i - 1] < ans) {
      ans = a[i + 1] - a[i - 1];
      index = i;
    }
  a.erase(a.begin() + index);
  ans = 0;
  for (int i = 1; i < n - 1; i++)
    if (a[i] - a[i - 1] > ans) ans = a[i] - a[i - 1];
  cout << ans;
  return 0;
}
