#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, a = 0, b = 1000, c = 0;
  cin >> n;
  vector<int> buf(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> buf[i];
    if (i > 1) {
      a = buf[i] - buf[i - 2];
      if (a < b) {
        b = a;
        c = i;
      }
    }
  }
  buf.erase(buf.begin() + c - 1);
  b = 0;
  n--;
  for (int i = 1; i < n; i++) {
    a = buf[i] - buf[i - 1];
    if (a > b) {
      b = a;
    }
  }
  cout << b;
}
