#include <bits/stdc++.h>
using namespace std;
long long kadane(const vector<long long> &v) {
  long long ans = 0;
  long long curr = 0;
  for (long long n : v) {
    curr += n;
    ans = max(ans, curr);
    if (curr < 0) curr = 0;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  scanf("%d", &n);
  vector<long long> v(n);
  for (int i = 0; i < n; i++) scanf("%lld", &v[i]);
  vector<long long> v2(n - 1), v3(n - 1);
  int x = -1;
  for (int i = 0; i + 1 < n; i++) {
    v2[i] = abs(v[i] - v[i + 1]) * x;
    v3[i] = v2[i] * -1;
    x = (x == -1) ? 1 : -1;
  }
  printf("%lld\n", max(kadane(v2), kadane(v3)));
  return 0;
}
