#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, Max = INT_MIN, Min = INT_MAX, count = 0;
  vector<int> vb[101], arr;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    arr.push_back(temp);
  }
  for (int i = 1; i < n - 1; i++) {
    for (int j = 0; j < n; j++) {
      if (j >= 1 && j <= n - 2) {
        if (i == j)
          continue;
        else
          vb[i].push_back(arr[j]);
      } else {
        vb[i].push_back(arr[j]);
      }
    }
    count++;
  }
  for (int i = 1; i <= count; i++) {
    Max = INT_MIN;
    for (int j = 1; j < vb[i].size(); j++) {
      Max = max(Max, (vb[i][j] - vb[i][j - 1]));
    }
    Min = min(Min, Max);
  }
  cout << Min << "\n";
  return 0;
}
