#include <bits/stdc++.h>
using namespace std;
int Difficulty(int a[], int n, int j) {
  int temp = a[j];
  a[j] = a[j - 1];
  int max = 0;
  for (int i = 0; i < n - 1; i++) {
    if (max < a[i + 1] - a[i]) {
      max = a[i + 1] - a[i];
    }
  }
  a[j] = temp;
  return max;
}
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int m = a[n - 1];
  for (int i = 1; i < n - 1; i++) {
    if (m > Difficulty(a, n, i)) {
      m = Difficulty(a, n, i);
    }
  }
  cout << m << endl;
}
