#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[100];
  int tmp1, tmp2, mind = 999999, maxd = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++)
    if (a[i + 1] - a[i] > maxd) maxd = a[i + 1] - a[i];
  for (int i = 1; i < n - 1; i++) {
    if (a[i + 1] - a[i - 1] < mind) mind = a[i + 1] - a[i - 1];
  }
  cout << max(mind, maxd);
  return 0;
}
