#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
void test_case() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (ll &x : a) cin >> x;
  ll ans = 0;
  for (int i = 0; i < n - 1; i++) {
    ans = max(ans, abs(a[i] - a[i + 1]));
  }
  cout << ans << '\n';
  return;
}
int main() {
  ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.tie(0);
  int t = 1;
  while (t--) test_case();
  return 0;
}
