#include <iostream>
using namespace std;
void main(void)
{
int mun = 0;
int valuetemp = 0;
int value[100] = {0};
int min_dif = 1000;
int count = 0;
cin >> mun;
for (int i = 0; i < mun; i++)
{
cin >> value[i];
}
for (int j = 1; j < mun - 2; j++)
{
int max = 0;
for (int i = 0; i < mun-1; i++)
{
int max_temp = 0;
if (i+1 == j)
max_temp = value[i + 2] - value[i];
else
if (i + 1 != j)
{
if (i != j)
{
max_temp = value[i + 1] - value[i];
}
}
if (max < max_temp)
max = max_temp;
}
if (min_dif > max)
min_dif = max;
}
cout << min_dif << endl;
}