#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100];
  cin >> n;
  int Max = 0, Min = 10000;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) Max = max(Max, a[i + 1] - a[i]);
  for (int i = 0; i < n - 2; i++) Min = min(Min, a[i + 2] - a[i]);
  cout << max(Max, Min);
  return 0;
}
