#include <bits/stdc++.h>
using namespace std;
void File() {
  freopen("name", "r", stdin);
  freopen("name", "r", stdout);
}
void fast() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  int n, x = 1, d = 0, mx = INT_MIN;
  cin >> n;
  vector<int> arr(n);
  vector<int> maxm;
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<int> tmp = arr;
  for (int i = 0; i < n - 2; i++) {
    tmp.erase(tmp.begin() + x);
    for (int j = 0; j < (int)tmp.size() - 1; j++) {
      d = tmp[j + 1] - tmp[j];
      if (d > mx) mx = d;
    }
    maxm.push_back(mx);
    mx = INT_MIN;
    d = 0;
    x++;
    tmp = arr;
  }
  cout << *min_element(((maxm).begin()), ((maxm).end())) << endl;
  return 0;
}
