#include <bits/stdc++.h>
using namespace std;
int n, a[100100];
long long dif[100100], sum1, sum2, maxs;
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    dif[i - 1] = abs(a[i - 1] - a[i]);
  }
  sum1 = sum2 = 0, maxs = dif[1];
  for (int i = 1; i < n; i++) {
    if (i % 2)
      sum1 += dif[i], sum2 -= dif[i];
    else
      sum1 -= dif[i], sum2 += dif[i];
    maxs = max(maxs, max(sum1, sum2));
    if (sum1 < 0) sum1 = 0;
    if (sum2 < 0) sum2 = 0;
  }
  printf("%lld\n", maxs);
  return 0;
}
