#include <bits/stdc++.h>
using namespace std;
int a[100005], p[100005];
long long z = 1, f[100005][2], ans;
int main() {
  int i, j, n, m;
  memset(f, 0xc0, sizeof(f));
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= n; i++) p[i] = abs(a[i + 1] - a[i]);
  f[1][1] = p[1];
  ans = p[1];
  for (i = 2; i <= n - 1; i++) {
    f[i][1] = p[i];
    f[i][1] = max(f[i][1], f[i - 1][0] + p[i]);
    f[i][0] = f[i - 1][1] - p[i];
    ans = max(ans, max(f[i][0], f[i][1]));
  }
  printf("%lld", ans);
  return 0;
}
