#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long b[n];
  for (long long i = 1; i < n; i++) b[i] = abs(a[i] - a[i + 1]);
  long long mx[n + 1], mn[n + 1];
  mx[n] = 0;
  mn[n] = 0;
  long long ans = LLONG_MIN;
  for (long long i = n - 1; i >= 1; i--) {
    mx[i] = b[i] - mn[i + 1];
    mn[i] = b[i] - mx[i + 1];
    mx[i] = max(mx[i], b[i]);
    ans = max(ans, mx[i]);
  }
  cout << ans << endl;
}
