#include <bits/stdc++.h>
using namespace std;
struct aa {
  int x, y;
  bool operator<(const aa &b) { return x < b.x; }
};
bool cmp(int a, int b) { return a > b; }
int bsearch(int *a, int n, int k);
int main() {
  int n, a[1000], ma = 0, mi = INT_MAX;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    ma = max(ma, a[i] - a[i - 1]);
  }
  for (int i = 2; i < n; i++) {
    mi = min(mi, a[i] - a[i - 2]);
  }
  cout << max(ma, mi);
  return 0;
}
int bsearch(int *a, int n, int k) {
  int l = 0, h = n;
  while (l < h) {
    int m = (l + h) / 2;
    if (a[m] == k)
      return m;
    else if (a[m] > k)
      h = m;
    else
      l = m + 1;
  }
  return l;
}
