#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[n - 1];
  for (int i = 0; i < n; i++) cin >> a[i];
  int big = 0, sb;
  for (int i = 0; i < n - 1; i++) {
    b[i] = a[i + 1] - a[i];
  }
  for (int i = 0; i < n - 2; i++) {
    sb = b[0];
    int c;
    for (int j = 0; j < n - 1;) {
      if (i == j) {
        c = b[j] + b[j + 1];
        j = j + 2;
      } else {
        c = b[j];
        j++;
      }
      if (c > sb) sb = c;
    }
    if (i != 0) {
      if (sb < big) big = sb;
    } else
      big = sb;
  }
  cout << big;
}
