#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  int a[100];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 1000;
  for (int skip = 1; skip < n - 1; skip++) {
    int tmp = 0;
    for (int i = 0; i < n - 1; i++) {
      if (i == skip) continue;
      int x = i + 1;
      if (x == skip) x++;
      tmp = max(tmp, a[x] - a[i]);
    }
    ans = min(ans, tmp);
  }
  cout << ans;
  return 0;
}
