#include <bits/stdc++.h>
using namespace std;
int a[105], x, mx = -1, ans = 1000000000;
int main() {
  scanf("%d", &x);
  for (int i = 0; i < x; i++) scanf("%d", &a[i]);
  for (int i = 1; i < x - 1; i++) {
    mx = -1;
    for (int j = 0; j < x - 1; j++) {
      if (j == i)
        continue;
      else if (j == i - 1)
        mx = max(mx, a[j + 2] - a[j]);
      else
        mx = max(mx, a[j + 1] - a[j]);
    }
    ans = min(ans, mx);
  }
  printf("%d\n", ans);
}
