#include <bits/stdc++.h>
using namespace std;
const int N = 100004;
long long a[N], b[N];
int n, p = 0;
long long fun(int n) {
  long long ans = 0, sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += b[i];
    if (sum < 0) sum = 0;
    ans = max(ans, sum);
  }
  return ans;
}
int main() {
  long long ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i < n; i++)
    a[i] = ((a[i + 1] - a[i]) > 0 ? (a[i + 1] - a[i]) : -(a[i + 1] - a[i]));
  --n;
  for (int i = 1; i <= n; i++) b[i] = i & 1 ? a[i] : -a[i];
  ans = fun(n);
  for (int i = 2; i <= n; i++) b[++p] = i & 1 ? -a[i] : a[i];
  ans = max(ans, fun(p));
  printf("%lld\n", ans);
}
