#include <bits/stdc++.h>
using namespace std;
int n;
int a[200000], b[200000];
long long get_max_value() {
  long long cur = 0, res = 0;
  for (int i = 0; i < n; ++i) {
    cur += b[i];
    if (cur < 0) cur = 0;
    if (cur > res) res = cur;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n; ++i) a[i] = abs(a[i] - a[i + 1]);
  n--;
  for (int i = 0; i < n; ++i) b[i] = (i % 2 == 0 ? a[i] : -a[i]);
  long long ans = 0;
  ans = max(ans, get_max_value());
  for (int i = 0; i < n; ++i) b[i] = (i % 2 != 0 ? a[i] : -a[i]);
  ans = max(ans, get_max_value());
  printf("%I64d\n", ans);
  return 0;
}
