#include <bits/stdc++.h>
using namespace std;
const int inf = int(1e9);
const int MaxN = int(1e5) + 256;
int n, m = inf, a[MaxN], ind, b[MaxN], A, B;
pair<int, int> p[MaxN];
string s, t, M;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i < n; i++) {
    if (m > a[i + 1] - a[i - 1]) {
      m = a[i + 1] - a[i - 1];
      ind = i;
    }
  }
  for (int i = 2; i <= n; i++) {
    if (i == ind)
      A = max(A, a[i + 1] - a[i - 1]);
    else
      A = max(A, a[i] - a[i - 1]);
  }
  cout << A;
  return 0;
}
