#include <bits/stdc++.h>
int main() {
  int n, co, min = 0, temp1, temp2, lolustoo, max = 10000;
  int a[1000];
  scanf("%d", &n);
  for (co = 0; co < n; co++) {
    scanf("%d", &a[co]);
  }
  for (co = 1; co < n - 1; co++) {
    min = 0;
    for (temp1 = 0; temp1 < n - 1; temp1++) {
      if (temp1 == co) continue;
      if (temp1 != co && temp1 + 1 != co) lolustoo = a[temp1 + 1] - a[temp1];
      if (temp1 + 1 == co) lolustoo = a[temp1 + 2] - a[temp1];
      if (lolustoo > min) min = lolustoo;
    }
    if (min < max) max = min;
  }
  printf("%d", max);
}
