#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 10;
int n;
long long a[M];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", a + i);
  }
  for (int i = 1; i < n; ++i) {
    a[i] = abs(a[i + 1] - a[i]);
    if (i & 1) a[i] = -a[i];
  }
  long long ans = -1e17;
  long long minn = 0;
  long long sum = 0;
  for (int i = 1; i < n; ++i) {
    sum += a[i];
    ans = max(ans, sum - minn);
    minn = min(minn, sum);
  }
  for (int i = 1; i < n; ++i) {
    a[i] = -a[i];
  }
  minn = 0;
  sum = 0;
  for (int i = 1; i < n; ++i) {
    sum += a[i];
    ans = max(ans, sum - minn);
    minn = min(minn, sum);
  }
  printf("%I64d\n", ans);
  return 0;
}
