#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[100000], b[810000], n, i, c, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n - 1; i++) {
    b[i] = abs(a[i + 1] - a[i]);
  }
  sort(b, b + n - 1);
  cout << b[n - 1 - 1] << endl;
}
