#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a;
  vector<int> m;
  int n, t, max = 0, s, si;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    a.push_back(t);
  }
  for (int i = 1; i < n - 1; i++) {
    s = a[i];
    a.erase(a.begin() + i);
    for (int j = 1; j < a.size(); j++) {
      if (a[j] - a[j - 1] > max) max = a[j] - a[j - 1];
    }
    m.push_back(max);
    max = 0;
    a.insert(a.begin() + i, s);
  }
  sort(m.begin(), m.end());
  cout << m[0] << endl;
  return 0;
}
