#include <bits/stdc++.h>
using namespace std;
long long int vowel(char a) {
  a = toupper(a);
  if ((a == 'A') || (a == 'E') || (a == 'I') || (a == 'O') || (a == 'U')) {
    return 1;
  }
  return 0;
}
vector<long long int> v;
map<long long int, long long int> mp;
int main() {
  long long int n, i, j, x, mn, mx, c, a[105];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  mn = 100000000000000000;
  for (j = 2; j <= n - 1; j++) {
    x = j;
    mx = 0, c = 0;
    for (i = 2; i <= n; i++) {
      if (i != x) {
        c = a[i] - a[i - 1];
        if (i - 1 == x) {
          c = a[i] - a[i - 2];
        }
        mx = max(mx, c);
      }
    }
    mn = min(mx, mn);
  }
  cout << mn << endl;
  return 0;
}
