#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, arr[100] = {0};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &arr[i]);
  }
  int min_num = 1000;
  for (int i = 1; i < n - 1; i++) {
    int max_sub = 0;
    for (int j = 0; j < n - 1; j++) {
      if (j == i) {
        if (abs(arr[j - 1] - arr[j + 1]) > max_sub)
          max_sub = abs(arr[j - 1] - arr[j + 1]);
      } else if (abs(arr[j] - arr[j + 1]) > max_sub)
        max_sub = abs(arr[j] - arr[j + 1]);
    }
    if (max_sub < min_num) min_num = max_sub;
  }
  printf("%d", min_num);
}
