#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int INF = 0x3f3f3f3f;
inline long long lllabs(long long x) { return x < 0 ? -x : x; }
long long a[N];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    a[0] = 0;
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    for (int i = 2; i <= n; i++) a[i - 1] = lllabs(a[i] - a[i - 1]);
    long long ans = 0, sum = 0, k = 1;
    for (int i = 1; i < n; i++) {
      sum += k * a[i];
      k = -k;
      ans = max(ans, sum);
      if (sum < 0) {
        sum = 0;
        k = 1;
      }
    }
    sum = 0;
    k = 1;
    for (int i = 2; i < n; i++) {
      sum += k * a[i];
      k = -k;
      ans = max(ans, sum);
      if (sum < 0) {
        sum = 0;
        k = 1;
      }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
