#include <bits/stdc++.h>
const long long max9 = 10 + 1e9, max6 = 10 + 1e6, max12 = 10 + 1e12,
                max15 = 10 + 1e15;
const long long min6 = -1 * max6, min9 = -1 * max9, min12 = -1 * max12,
                min15 = -1 * max15;
const long long R = 7 + 1e9, NN = 10 + 1e5;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    int ans = 0;
    cin >> n;
    int a[n];
    for (int i = (0); i < (n); ++i) cin >> a[i];
    for (int i = (0); i < (n - 1); ++i) {
      ans = max(a[i + 1] - a[i], ans);
    }
    int out = max6;
    for (int i = (0); i < (n - 2); ++i) {
      out = max(ans, min(out, a[i + 2] - a[i]));
    }
    cout << out;
  }
  return 0;
}
