#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long> a(n);
  for (int i = 0; i < n; i++) {
    long x;
    cin >> x;
    a[i] = x;
  }
  long long b[n], c[n];
  for (int i = 0; i < n - 1; i++) {
    b[i] = abs(a[i] - a[i + 1]);
    c[i] = b[i];
    if (i % 2 == 0) {
      b[i] = -1 * b[i];
    } else {
      c[i] = -1 * c[i];
    }
  }
  long long ans = 0;
  for (int i = 1; i < n - 1; i++) {
    b[i] = max(b[i], b[i] + b[i - 1]);
    c[i] = max(c[i], c[i] + c[i - 1]);
  }
  for (int i = 0; i < n - 1; i++) {
    long long x = max(b[i], c[i]);
    ans = max(x, ans);
  }
  cout << ans;
  return 0;
}
