#include <bits/stdc++.h>
const int N = 1000005;
using namespace std;
long long n, a[N];
long long b[N], c[N];
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    int t = abs(a[i] - a[i + 1]);
    if (i & 1) {
      b[i] = t;
      c[i] = -t;
    } else {
      b[i] = -t;
      c[i] = t;
    }
  }
  long long ans = 0, now = 0;
  for (int i = 1; i < n; i++) {
    now += b[i];
    if (now > ans) ans = now;
    if (now < 0) now = 0;
  }
  now = 0;
  for (int i = 1; i < n; i++) {
    now += c[i];
    if (now > ans) ans = now;
    if (now < 0) now = 0;
  }
  cout << ans << '\n';
  return 0;
}
