#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 99999;
  int arr[102], tmp[102];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i < n - 1; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      if (j != i) tmp[cnt++] = arr[j];
    }
    int mx = -1;
    for (int j = 1; j < n - 1; j++) mx = max(mx, tmp[j] - tmp[j - 1]);
    ans = min(ans, mx);
  }
  cout << ans;
  return 0;
}
