#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, min1 = 2000, val, max1 = 0;
  long long int a[200];
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int j1 = 0; j1 < (n - 1); j1++) {
    if (a[j1 + 1] - a[j1] > max1) {
      max1 = a[j1 + 1] - a[j1];
    }
  }
  for (long long int j = 0; j < (n - 2); j++) {
    val = a[j + 2] - a[j];
    if (val < min1) {
      min1 = val;
    }
  }
  if (min1 > max1)
    cout << min1 << endl;
  else
    cout << max1 << endl;
}
