#include <bits/stdc++.h>
using namespace std;
long long n, i, a[109], b[109], Mi, M, B[109];
int main() {
  cin >> n;
  cin >> a[1];
  for (i = 2; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i] - a[i - 1];
  }
  for (i = 2; i < n; i++) B[i] = a[i + 1] - a[i - 1];
  M = b[2];
  for (i = 3; i <= n; i++) M = max(M, b[i]);
  Mi = B[2];
  for (i = 3; i < n; i++) Mi = min(Mi, B[i]);
  cout << max(Mi, M) << endl;
  return 0;
}
