#include <bits/stdc++.h>
using namespace std;
inline char tc(void) {
  static char fl[10000], *A = fl, *B = fl;
  return A == B && (B = (A = fl) + fread(fl, 1, 10000, stdin), A == B) ? EOF
                                                                       : *A++;
}
inline int read(void) {
  int a = 0, f = 1;
  char c;
  while ((c = tc()) < '0' || c > '9') c == '-' ? f = -1 : 0;
  while (c >= '0' && c <= '9') a = a * 10 + c - '0', c = tc();
  return a * f;
}
int n, a[200005];
long long mix[2], now[2], ans;
int main(void) {
  register int i;
  n = read();
  for (i = 1; i <= n; ++i) a[i] = read();
  mix[0] = mix[1] = 0;
  for (i = 1; i < n; ++i) {
    now[0] += (i & 1 ? -1 : 1) * abs(a[i] - a[i + 1]),
        now[1] += (i & 1 ? 1 : -1) * abs(a[i] - a[i + 1]);
    mix[0] = min(mix[0], now[0]), mix[1] = min(mix[1], now[1]);
    ans = max(ans, max(now[1] - mix[1], now[0] - mix[0]));
  }
  printf("%lld\n", ans);
  return 0;
}
