#include <bits/stdc++.h>
using namespace std;
int n, m, i, c[100005], a, b, v, k, t[100005];
set<int> g[100005];
vector<int> first_half;
vector<int> second_half;
vector<int> total;
int par[209], group[209];
int arra[150000];
vector<int> arr;
map<char, int> cp;
map<long long int, long long int> mp;
deque<char> stp1;
deque<char> stp2;
map<long long int, long long int> pos;
map<string, int> check;
map<string, string> server;
vector<string> ans1;
vector<string> ans2;
vector<string> ans3;
string server1[1009];
string ip1[1009];
string server2[1009];
string ip2[1009];
long long int cashier[109];
long long int fir[109];
long long int sec[100009];
vector<long long int> sl1;
vector<long long int> sl2;
map<long long int, long long int> contest_pos;
vector<long long int> gukiz;
vector<long long int> original;
long long int diff[109];
int main() {
  long long int a, b, c = 0, d = 1, e, f = 100000000000000, g = -1, h = -1, i,
                      j, k, l = 1000000000000, n, s1 = 0, s2 = 1, m1 = 5,
                      m2 = 15, t, m, mod = 1000000007;
  long long int x1, x2, y1, y2;
  cin >> n;
  string num;
  for (i = 0; i < n; i++) {
    cin >> diff[i];
  }
  for (i = 1; i < n; i++) {
    d = max(d, diff[i] - diff[i - 1]);
  }
  for (i = 1; i < n - 1; i++) {
    a = diff[i] - diff[i - 1];
    b = diff[i + 1] - diff[i - 1];
    c = max(a, b);
    l = min(l, c);
  }
  cout << max(l, d);
}
