#include <bits/stdc++.h>
int main() {
  int a[105], b[105];
  int n, i, j, k, max, min, sub;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  min = 10000;
  for (k = 2; k < n; k++) {
    j = 1;
    for (i = 1; i < k; i++) {
      b[j++] = a[i];
    }
    for (i = k + 1; i <= n; i++) {
      b[j++] = a[i];
    }
    sub = 0;
    max = 0;
    for (j = 1; j < n - 1; j++) {
      sub = b[j + 1] - b[j];
      if (sub >= max) {
        max = sub;
      }
    }
    if (max <= min) {
      min = max;
    }
  }
  printf("%d\n", min);
  return 0;
}
