#include <bits/stdc++.h>
int a[200];
int main() {
  int n, mx = 0, mn = 5000;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n; ++i)
    if (a[i + 1] - a[i] > mx) mx = a[i + 1] - a[i];
  for (int i = 1; i < n - 1; ++i)
    if (mn > a[i + 1] - a[i - 1]) mn = a[i + 1] - a[i - 1];
  if (mx > mn)
    printf("%d", mx);
  else
    printf("%d", mn);
  return 0;
}
