#include <bits/stdc++.h>
using namespace std;
long long int kadane(vector<long long int> v) {
  if (v.size() == 0) return INT_MIN;
  long long int n = v.size();
  long long int curr_max = v[0], ans = v[0];
  for (int i = 1; i < n; i++) {
    curr_max = max(curr_max + v[i], v[i]);
    ans = max(curr_max, ans);
  }
  return ans;
}
int main() {
  long long int n;
  scanf("%lld", &n);
  long long int a[n];
  for (__typeof(n) i = 0 - (0 > n); i != n - (0 > n); i += 1 - 2 * (0 > n))
    scanf("%lld", &a[i]);
  vector<long long int> v;
  for (int i = 1; i < n; i++) {
    v.push_back(abs(a[i] - a[i - 1]));
    if (i % 2 == 0) v[i - 1] *= -1;
  }
  long long int ans1 = kadane(v);
  reverse(v.begin(), v.end());
  v.pop_back();
  reverse(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) v[i] *= -1;
  long long int ans2 = kadane(v);
  printf("%lld\n", max(ans1, ans2));
  return 0;
}
