#include <bits/stdc++.h>
using namespace std;
string tostring(long long n) {
  ostringstream ss;
  ss << n;
  return ss.str();
}
long long tonumber(string str) {
  stringstream ss;
  ss << str;
  long long n;
  ss >> n;
  return n;
}
int main() {
  int n, num;
  int d = -2147483647, res = 2147483647;
  vector<int> v, v1;
  cin >> n;
  for (int i = (0); i < (n); i++) {
    cin >> num;
    v.push_back(num);
  }
  v1 = v;
  for (int i = (1); i < (n - 1); i++) {
    d = -2147483647;
    v1.erase(v1.begin() + i);
    for (int j = 1; j < n - 1; j++) {
      if (v1[j] - v1[j - 1] > d) d = (v1[j] - v1[j - 1]);
    }
    if (d < res) res = d;
    v1 = v;
  }
  cout << res << endl;
}
