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