#include <bits/stdc++.h>
using namespace std;
const long long lnf = (1LL << 61);
int n;
int* a;
long long sodd = 0, suodd = 0;
long long great[2][2] = {{lnf, -lnf}, {lnf, -lnf}};
long long res = -0x3fffffff;
inline void init() {
  scanf("%d", &n);
  a = new int[(const int)(n + 1)];
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i < n; i++) a[i] = abs(a[i + 1] - a[i]);
}
inline void solve() {
  if (n == 2) {
    printf("%d\n", a[1]);
    return;
  }
  great[0][0] = great[0][1] = 0;
  for (int i = 1; i < n; i++) {
    if (i & 1) {
      sodd += a[i];
      long long c = sodd - suodd;
      (res) = max((res), (c - great[0][0]));
      (res) = max((res), (great[1][1] - c));
      (great[1][1]) = max((great[1][1]), (c));
    } else {
      suodd += a[i];
      long long c = sodd - suodd;
      (res) = max((res), (c - great[0][0]));
      (res) = max((res), (great[1][1] - c));
      (great[0][0]) = min((great[0][0]), (c));
    }
  }
  printf("%I64d", res);
}
int main() {
  init();
  solve();
  return 0;
}
