#include <bits/stdc++.h>
using namespace std;
int main() {
  int elem;
  cin >> elem;
  vector<int> V1(elem);
  set<int> differences;
  for (int i = 0; i < elem; i++) {
    cin >> V1[i];
  }
  set<int> responses;
  if (elem == 3) {
    cout << V1[2] - V1[0];
  } else {
    for (int i = 1; i < elem - 2; i++) {
      differences.insert(abs(V1[i - 1] - V1[i + 1]));
      for (int j = 0; j < elem - 1; j++) {
        if (j + 1 == i) {
          differences.insert(abs(V1[j] - V1[j + 2]));
        } else if (j == i) {
        } else {
          differences.insert(abs(V1[j] - V1[j + 1]));
        }
      }
      set<int>::iterator IT = differences.end();
      IT--;
      responses.insert(*IT);
      differences.clear();
    }
    set<int>::iterator I2 = responses.begin();
    cout << *I2;
  }
  return 0;
}
