#include <bits/stdc++.h>
int main() {
  int n, s, t, temp = 0;
  scanf("%d", &n);
  int a[1000], b[1000], q = 0;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n - 1; i++) {
    for (int j = 0; j < n; j++) {
      if (j != i) {
        b[q] = a[j];
        q++;
      }
    }
    int diff;
    for (int j = 0; j < q - 1; j++) {
      if (j == 0)
        diff = b[j + 1] - b[j];
      else {
        int k = b[j + 1] - b[j];
        if (diff < k) diff = k;
      }
    }
    if (temp == 0) {
      s = i;
      t = diff;
      temp = 1;
    } else {
      if (t > diff) {
        s = i;
        t = diff;
        temp = 1;
      }
    }
    q = 0;
  }
  printf("%d", t);
  return 0;
}
