#include <bits/stdc++.h>
using namespace std;
int n, i, j, k, u = 10001, a[101], q;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 2; i < n; i++) {
    for (j = 1; j < n; j++) {
      if (a[j + 1] == a[i])
        q = a[j + 2] - a[j], j++;
      else
        q = a[j + 1] - a[j];
      if (q > k) k = q;
    }
    if (k < u) u = k;
    k = 0;
  }
  cout << u;
}
