#include <bits/stdc++.h>
using namespace std;
long long maxSubArraySum(long long a[], long long size) {
  long long max_so_far = 0, max_ending_here = 0;
  for (long long i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
int main() {
  long long n;
  cin >> n;
  long long temp, l0, r0;
  vector<long long> myvect(n, 0);
  long long memo[n - 1];
  for (long long i = 0; i < n; ++i) {
    cin >> myvect[i];
  }
  long long a = 1;
  for (long long i = 0; i < n - 1; ++i) {
    memo[i] = abs(myvect[i] - myvect[i + 1]) * a;
    a *= -1;
  }
  long long maxValue = maxSubArraySum(memo, n - 1);
  for (long long i = 0; i < n - 1; ++i) {
    memo[i] = memo[i] * (-1);
  }
  long long maxValue2 = maxSubArraySum(memo, n - 1);
  cout << max(maxValue, maxValue2);
  return 0;
}
