#include <bits/stdc++.h>
using namespace std;
int aa[101];
int main() {
  int n, a, b = 1000;
  scanf("%d", &n);
  scanf("%d%d", &aa[0], &aa[1]);
  a = aa[1] - aa[0];
  for (int i = 2; i < n; i++) {
    scanf("%d", &aa[i]);
    if (aa[i] - aa[i - 2] < b) b = aa[i] - aa[i - 2];
    if (aa[i] - aa[i - 1] > a) a = aa[i] - aa[i - 1];
  }
  if (b > a)
    printf("%d", b);
  else
    printf("%d", a);
  return 0;
}
