#include <bits/stdc++.h>
using namespace std;
int n, a[301], mx, d;
int main() {
  cin >> n >> a[1];
  for (int i = 2; i <= n; i++) {
    cin >> a[i];
    if (a[i] - a[i - 1] > mx) mx = a[i] - a[i - 1];
  }
  d = a[3] - a[1];
  for (int i = 3; i < n; i++)
    if (a[i + 1] - a[i - 1] < d) d = a[i + 1] - a[i - 1];
  if (mx > d)
    cout << mx;
  else
    cout << d;
  return 0;
}
