#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
int N[MAX];
int Res1[MAX];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> N[i];
  int max = 0;
  for (int i = 0; i < n - 1; i++)
    if (N[i + 1] - N[i] > max) max = N[i + 1] - N[i];
  int min = 10000;
  for (int i = 0; i < n - 2; i++) {
    if (max > N[i + 2] - N[i]) {
      if (min > max) min = max;
    } else if (N[i + 2] - N[i] < min)
      min = N[i + 2] - N[i];
  }
  cout << min << endl;
  return 0;
}
