#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[105];
  int n, i, ans = 0, mn = 999999;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n - 1; i++)
    if ((a[i + 1] - a[i]) > ans) ans = a[i + 1] - a[i];
  for (i = 0; i < n - 2; i++)
    if ((a[i + 2] - a[i]) < mn) mn = a[i + 2] - a[i];
  cout << max(ans, mn) << endl;
  return 0;
}
