#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 1000, y = 0, c = 0, r = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 2; i < n; i++) {
    c = a[i] - a[i - 2];
    if (c < x) x = c;
  }
  for (int i = 0; i < n - 1; i++) {
    r = a[i + 1] - a[i];
    if (r > y) y = r;
  }
  x > y ? cout << x : cout << y;
  return 0;
}
