#include <bits/stdc++.h>
static const int Infinity = 2e9;
int main(int argc, const char* argv[]) {
  int n;
  std::cin >> n;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) std::cin >> v[i];
  int min = Infinity;
  for (int i = 1; i < n - 1; i++) {
    int max = 0;
    for (int j = 1; j < n; j++) {
      if (j - 1 == i)
        max = std::max(v[j] - v[j - 2], max);
      else
        max = std::max(v[j] - v[j - 1], max);
    }
    if (min > max) min = max;
  }
  std::cout << min << std::endl;
  return 0;
}
