#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _f(const char* name, T&& arg) {
  cout << name << ": " << arg << '\n';
}
template <typename T, typename... Args>
void _f(const char* names, T&& arg, Args&&... args) {
  const char* split = strchr(names + 1, ',');
  cout.write(names, split - names) << ": " << arg << " |";
  _f(split, args...);
}
double tick() {
  static clock_t oldtick;
  clock_t newtick = clock();
  double diff = 1.0 * (newtick - oldtick) / CLOCKS_PER_SEC;
  oldtick = newtick;
  return diff;
}
int main(int argc, char** argv) {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(5);
  cout << fixed;
  int n;
  cin >> n >> ws;
  vector<int> aa(n, 0);
  for (int i = (0); i < (n); ++i) {
    cin >> aa[i];
  }
  int ret = (1 << 30);
  for (int i = (1); i < (n - 1); ++i) {
    int pre = aa[0], diff = 0;
    for (int j = (1); j < (n); ++j) {
      if (j == i) ++j;
      diff = max(diff, aa[j] - pre);
      pre = aa[j];
    }
    ret = min(ret, diff);
  }
  cout << (ret) << '\n';
  return 0;
}
