#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long b[100005];
long long c[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i < n; i++) {
    b[i] = a[i + 1] - a[i];
    if (b[i] < 0) b[i] = -b[i];
  }
  c[0] = 0ll;
  for (int i = 1; i < n; i++) {
    if (i % 2)
      c[i] = c[i - 1] + b[i];
    else
      c[i] = c[i - 1] - b[i];
  }
  sort(c, c + n);
  printf("%I64d\n", c[n - 1] - c[0]);
  return 0;
}
