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