#include <bits/stdc++.h>
inline long long llabs(long long x) { return x < 0 ? -x : x; }
long long b[100000], m = 0;
int n;
void dp() {
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += b[i];
    if (sum < 0) {
      sum = 0;
      continue;
    }
    if (b[i] > 0) m = m > sum ? m : sum;
  }
}
int main() {
  scanf("%d", &n);
  long long num, last;
  scanf("%I64d", &last);
  n--;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &num);
    b[i] = (i & 1 ? -1 : 1) * llabs(num - last);
    last = num;
  }
  dp();
  for (int i = 0; i < n; i++) b[i] = -b[i];
  dp();
  printf("%I64d", m);
  return 0;
}
