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